i had make PvP Scripts, but its not saved.
i mean the DATA is not Saved.
When i leave is normal, got saved.
but when i join, my data get reset again.
Here my scripts
Refresh(id)
Hook Join & Leave
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
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
--// Save Data \\-- function save(id,usgn) 	local usgn = player(id,"name") 	file = io.output(io.open("sys/lua/LOL/data/"..usgn..".txt","w+")) 	local text = "" 	 	-- Leveling System -- 	text = tostring(level[id]) 	text = text .." ".. exp[id] 	text = text .." ".. maxexp[id] 	 	-- Bank System -- 	text = text .." ".. bank_account[id] 	text = text .." ".. bank[id] 	 	-- Player Access -- 	text = text .." ".. shop_access[id] 	text = text .." ".. heal_room[id] 	text = text .." ".. staff_room[id] 	 	-- Player Skill -- 	text = text .." ".. weapons_useable[id] 	text = text .." ".. laser_useable[id] 	text = text .." ".. speed_buyable[id] 	 	-- UserGroup -- 	text = text .." ".. usergroup[id] 	text = text .." ".. vip[id] 	 	-- Player Resource -- 	text = text .." ".. gold[id] 	text = text .." ".. skill_point[id] 	text = text .." ".. title[id] 	 	text = text .." ".. hp[id] 	text = text .." ".. dmg[id] 	 	text = text .." ".. Character[id] 	text = text .." ".. FirstTime[id] 	 	file:write(text) 	file:close() end
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
56
57
58
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
56
57
58
--// Load Data \\-- function load(id,usgn) 	local usgn = player(id,"name") 	local filename = "sys/lua/LOL/data/%s.txt" 	if player(id,"usgn") == 0 then 		local file = io.open(filename:format(usgn,"r")) 		if file then 			for line in file:lines() do 				local parses = totable(line) 				 				local w1=tonumber(parses[1]) 				local w2=tonumber(parses[2]) 				local w3=tonumber(parses[3]) 				local w4=tonumber(parses[4]) 				local w5=tonumber(parses[5]) 				local w6=tonumber(parses[6]) 				local w7=tonumber(parses[7]) 				local w8=tonumber(parses[8]) 				local w9=tonumber(parses[9]) 				local w10=tonumber(parses[10]) 				local w11=tonumber(parses[11]) 				local w12=tonumber(parses[12]) 				local w13=tonumber(parses[13]) 				local w14=tonumber(parses[14]) 				local w15=tonumber(parses[15]) 				local w16=tonumber(parses[16]) 				local w17=tonumber(parses[17]) 				local w18=tonumber(parses[18]) 				local w19=tonumber(parses[19]) 				local w20=tonumber(parses[20]) 				 				if w1 ~= nil then level[id] = w1 end 				if w2 ~= nil then exp[id] = w2 end 				if w3 ~= nil then maxexp[id] = w3 end 				if w4 ~= nil then bank_account[id] = w4 end 				if w5 ~= nil then bank[id] = w5 end 				if w6 ~= nil then shop_access[id] = w6 end 				if w7 ~= nil then heal_room[id] = w7 end 				if w8 ~= nil then staff_room[id] = w8 end 				if w9 ~= nil then weapons_useable[id] = w9 end 				if w10 ~= nil then laser_useable[id] = w10 end 				if w11 ~= nil then speed_buyable[id] = w11 end 				if w12 ~= nil then usergroup[id] = w12 end 				if w13 ~= nil then vip[id] = w13 end 				if w14 ~= nil then gold[id] = w14 end 				if w15 ~= nil then skill_point[id] = w15 end 				if w16 ~= nil then title[id] = w16 end 				if w17 ~= nil then hp[id] = w17 end 				if w18 ~= nil then dmg[id] = w18 end 				if w19 ~= nil then Character[id] = w19 end 				if w20 ~= nil then FirstTime[id] = w20 end 			end 		else 			refresh(id) 		end 	end end
Refresh(id)
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
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
function refresh(id) 	-- Anime Category -- 	Character[id] = 0 	FirstTime[id] = 1 	 	-- Player Resource -- 	gold[id] = 50 	skill_point[id] = 0 	title[id] = 1 	 	-- UserGroup -- 	usergroup[id] = 0 	vip[id] = 0 	 	-- Player Skill -- 	weapons_useable[id] = 0 	laser_useable[id] = 0 	speed_buyable[id] = 0 	 	-- Player Access -- 	shop_access[id] = 0 	heal_room[id] = 0 	staff_room[id] = 0 	 	-- Bank System -- 	bank_account[id] = 0 	bank[id] = 0 	 	-- Leveling System -- 	level[id] = 1 	exp[id] = 0 	maxexp[id] = 170 	 	-- Player Stats -- 	hp[id] = 500 	dmg[id] = 10 end
Hook Join & Leave
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("join", "_F.join") function _F.join(id) 	msg(hijau.."Welcome "..biru..""..player(id,"name")..""..hijau.." to "..game("sv_name")) 	load(id,usgn) -- Load Data will be Executed here, Right? 	 	if player(id,"usgn") > 0 then 		msg2(id,hijau.."[USGN] "..emas.."Thanks for Login with your USGN.") 		msg2(id,hijau.."[USGN] "..emas.."Your data enabled for saved.") 	else 		msg2(id,merah.."[USGN] "..emas.."You are not Login!, your data Disabled for Saved.") 	end 	if usergroup[id] > 0 then 		msg2(id,putih.."[Staff] "..emas.."Welcome Staff.") 	end end
1
2
3
4
2
3
4
addhook("leave", "_F.leave") function _F.leave(id) 	save(id,usgn) -- Savedata. end
Please!, Can you fix it?
Thanks!
Sorry for my English.
EDIT: Forgot to add Refresh Function.