ID:164821
 
mob
Login()
usr.loc = locate(6,6,4)
if(usr.key == "Shomone")
world << "<b><font color=blue>Owner [usr] has entered the world!"
switch(alert("Which one whould you like to choose?","","New","Load","Quit"))
if("New")
if (fexists("players/[usr.ckey].sav")) // Check if they have a save file
switch(alert("If you continue with a new character, your previous character will be erased. Do you wish to continue?","[world.name]","Yes","No"))
if ("Yes")
usr << "... Ok... Beginning character process now."
usr.loc = locate(17,6,4)
return ..()
if ("No")
usr << "Ok, Please reconnect for you are being disconnected now"
del(usr)
return ..()
else
return ..()
usr.loc = locate (17,6,4)
if("Load")
LoadCharacter() // The load character proc
if("Quit")
usr << "Bye bye."
del(src)



mob
proc
LoadCharacter() // The load character proc
var/savefile/F = new("players/[src.ckey].sav") // define the location of the save file
var/X // Defines a temporary X variable
var/Y // Defines a temporary Y variable
var/Z // Defines a temporary Z variable
var/mob/newmob = new() // Initialize a new mob
F["name"] >> name // Load the name from the list into the character's name
F["X"] >> X // Load the X variable from the savefile to the temporary X variable
F["Y"] >> Y // Load the Y variable from the savefile to the temporary Y variable
F["Z"] >> Z // Load the Z variable from the savefile to the temporary Z variable
F["Mob"] >> newmob // Load all the mob data into the initialized mob
newmob.loc = locate(X,Y,Z) // Move the initialized mob to the last saved location
newmob.client = src.client // Set the mob's client to players client


When ever i click load the menu is still there and if i click load again there is a mob of me standing here
Well...try not to use usr in log in. That wont fix the entire problem.
In response to Revojake
I can see there being multiple problems with your code but I did notice one big thing about your loading code. You should add this right above the first line F["name"] >> name

Read(F)