ID:144962
 
Code:
mob/combatant/player/Login()
..()
Naming
name= input("What will your name be?")
if(src.name== null)
goto Naming

if(src.name=="")
goto Naming


Problem description:This is just a simple code for someone naming their character. It works fine but if someone presses the space bar a couple of times and then clicks ok it doesn't read it as null or "". So how do I get around this?

There's the ! operator that works like your == null line except it changes for total empty values. That won't fix your problem, but it will save some headaches down the line.

You need to check the text against the value of ckey(text), ckey() strips out spaces and special characters, so it would look something like this:
if(!ckey(name))
// Do stuff


Next you shouldn't be using 'goto' at all here, in DM it's bad practice in most cases since loops work more efficently:

var/name
while(!ckey(name)) // While there's no name set.
name = input("What will your name be?")as null|text // as null|text gives it a cancel button.


That will continue going until a name is selected.