ID:1530093
 
(See the best response by Kaiochao.)
Code:
client
proc/save()
var/savefile/F=new("S123/F23/[ckey]")
F << usr
client/New()
var/savefile/F=new("S123/F23/[ckey]")
if(F)
F >> usr
usr << "<font color=red>File loaded!"
else
usr << "<font color=red>File not found!"
..()


Problem description:
Upon a reboot it won't save the amount of kills you have gained/the rank you earned. Here's the code for the ranks.
Code:
mob
var
rank="Academy Student"
kills=0
proc
gain_kill(var/mob/M)
M.kills+=1
M << "<font color=yellow><i>You now have [M.kills] kills"
var/A=M.rank
if(M.kills==5)M.rank="Genin"
if(M.kills==20)M.rank="Chunin"
if(M.kills==50)M.rank="Jounin"
if(M.kills==100)M.rank="Anbu"
if(M.kills==150)M.rank="Kage"
if(M.kills==200)M.rank="Legend"
if(A!=M.rank)
M << "<font color=#00CCFF>Congratulations! You have been promoted to the rank of [M.rank]"

1) Don't use usr in proc.

2) You shouldn't assign to usr like that.

3) You should not be using client/New(), but rather a temporary login mob.

world
mob = /mob/login_mob

mob
login_mob
Login()
var/mob/player/p
var/savefile/F = new("S123/F23/[ckey]")
F >> p
p.key = src.key
del src
player

client
proc/save()
var/savefile/F=new("S123/F23/[ckey]")
F >> src.mob
I'll try it and see, thanks in advance for helping!
Best response
Loading a mob in client/New() should be fine. Its default behavior won't create a new mob if the client already has one.

The temporary mob is only necessary if you plan on having user interaction before loading, such as a title screen.
In response to Ter13
I think you flipped the operator in save() right?
When I did what you said, 3 errors came up when compiling. usr.Save: undefined proc, usr.Save: undefined proc and attacker.Save: undefined proc.
Kaiochao and I(mainly Kaiochao) finally fixed it after hours. Problem solved. Thanks once again!