ID:144464
 
Code:
mob
proc //ignore the indentation i added that bit in.
newchar2()
var/user_name = ""
do
user_name = input(src, "Your name?", "Name") as null|text
while(isValidName(user_name))
src.name = user_name
src.icon = 'M-norm.dmi'
src.icon_state = "Normal"
world<<"<font size = 1><font color = green><B>Event: <font color = black>[src.name] has logged in</font>"
src.Save()

loadchar2()
src.Load()
src.ingame = 1
world<<"<font size = 1><font color = green><B>Event: <font color = black>[src.name] has logged in</font>"
return ..()

proc/isValidName(name)
if(!name) // return 0 when the conditions do not meet
return 0
if(length(name) > 15)
src << "<font size = 1><font color = red><b>System:</b></font><font size = 1><font color = black><b> Your name is too long.</b></font>"
return 0
for(var/i in un_wanted_names + html)
if(findtext(name, i))
src << "<font size = 1><font color = red><b>System:</b></font><font size = 1><font color = black><b> Please do not put HTML in names.</b></font>"
return 0
return 1 // return true if all the conditions passed


Problem description:

Login.dm:132:error::invalid expression
on
src.name = user_name

if i remove that line it goes to the line under it.
You're not using do() while() correctly. Look it up.