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
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
function totable(t,match) local cmd = {} if not match then match = "[^%s]+" end for word in string.gmatch(t, match) do table.insert(cmd, word) end return cmd end addhook("join","load") function load(id) usgn = player(id,"usgn") if (usgn > 0) then local usgn = player(id, "usgn") files = io.open('sys/lua/saves/'..player(id,"usgn")..'.txt','r') if(files~=nil) then msg2(id,'©000255000Your save file found!@C') msg2(id,'©160160255Your U.S.G.N ID: '..player(id,"usgn")..'@C') for line in io.lines('sys/lua/saves/'..player(id,"usgn")..'.txt','r') do local parses = totable(line) if (tonumber(parses[1])>0) then yourmon[id] = tonumber(parses[1]) license[id] = tonumber(parses[2]) break end end else msg2(id,'©255000000Failed to load save!@C') msg2(id,'©255000000Please check your U.S.G.N account settings!@C') end end end addhook("leave","save") function save(id) if (player(id,"usgn") > 0) then save_data = yourmon[id].." "..license[id] file = assert(io.open('sys/lua/saves/'..player(id,"usgn")..'.txt','w')) file:write(save_data) file:close() msg2(id,'©000255001Save Data Successfull!@C') else msg2(id,'©255000000Failed to Save!@C') end end