This script doesn't work for a Server ,the score/deaths load function don't work,but in "New Game" it work,any idea?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
savestr={} function readfile(filelocation, linenum) saveline=1 for line in io.lines(filelocation) do savestr[saveline]=line saveline=saveline+1 end return savestr[linenum] end addhook("kill","a_save") function a_save(id) usgn = player(id,"usgn") local c = player(id,"score") if usgn ~= 0 then SScore = io.open("sys/lua/Scores/"..player(id,"usgn")..".txt", "w") SScore:write(""..c.."") SScore:close() return 1 end end addhook("die","b_save") function b_save(id) usgn = player(id,"usgn") local c2 = player(id,"deaths") if usgn ~= 0 then SScore2 = io.open("sys/lua/Scores/"..player(id,"usgn").."_2.txt", "w") SScore2:write(""..c2.."") SScore2:close() return 1 end end addhook("join","a_load") function a_load(id) usgn = player(id,"usgn") if usgn ~= 0 then score = readfile("sys/lua/Scores/"..player(id,"usgn")..".txt", 1)-1+1 parse("setscore "..id.." "..score) msg2(id,"©000255000Your score was succesfully loaded") return 1 end end addhook("join","b_load") function b_load(id) usgn = player(id,"usgn") if usgn ~= 0 then score2 = readfile("sys/lua/Scores/"..player(id,"usgn").."_2.txt", 1)-1+1 parse("setdeaths "..id.." "..score2) msg2(id,"©000255000Your deaths was succesfully loaded") return 1 end end