I edited Levels and Exp (20) script but i have a problem in a command..
The problem is some of the cmds don't work and when i try to use !info , !get_lvl , !set_lvl and !give_adm , the txt i sent don't disappear .
Script
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
function initArray(m) local array = {} for i = 1, m do array[i]=0 end return array end level=initArray(32) exp=initArray(32) toexp=initArray(32) money=initArray(32) admin=initArray(32) function string.split(text,b) local cmd = {} if b then b = b else b = "%s" end b = "[^"..b.."]+" for o in string.gmatch(text,b) do table.insert(cmd,o) end return cmd end 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("ms100","save_hud") function save_hud() for id = 1,32 do if (player(id,"exists")) then parse('hudtxt2 '..id..' 47 "©000100255Money: '..money[id]..' " 13 141') parse('hudtxt2 '..id..' 48 "©000100255Level: '..level[id]..' " 13 117') parse('hudtxt2 '..id..' 49 "©000100255Exp: '..exp[id]..'/'..toexp[id]..' " 13 129') end end end addhook("kill","save_kill") function save_kill(id) 	money[id]=money[id]+25 	exp[id]=exp[id]+1 	if exp[id] == toexp[id] then 	toexp[id]=toexp[id]*2 	money[id]=money[id]+100 		exp[id]=0 		level[id]=level[id]+1 		msg2(id,"©000255000Level up!@C") 		parse("sv_sound2 "..id.." levelup.wav") 		msg("©255075000"..player(id,"name").." reached "..level[id].." level!") 	end 	if exp[id] < toexp[id] then 		parse("sv_sound2 "..id.." coin.wav") 	end end addhook("leave","save_leave") -- When you leave it saves function save_leave(id) if (player(id,"usgn")>0) then io.output(io.open("sys/lua/saves/"..player(id,"usgn")..".txt","w+")) io.write(exp[id].." "..level[id].." "..money[id].." "..toexp[id]) io.close() end end addhook("die","save_die") -- When you die it saves function save_die(id) if (player(id,"usgn")>0) then io.output(io.open("sys/lua/saves/"..player(id,"usgn")..".txt","w+")) io.write(exp[id].." "..level[id].." "..money[id]) io.close() end end addhook("join","save_join") -- When join load function save_join(id) 	if (player(id,"usgn")>0) then 		local filename = "sys/lua/saves/%s.txt" 		local file = io.open(filename:format(player(id,"usgn"), "r")) 		local line 		if not file then 			line = {0, 1} 			msg2(id,"©255000000Failed to save!@C") 		else 			line = file:read("*a"):split() 		end 		exp[id] = tonumber(line[1]) or 0 -- If line[1] is not a number, level[id] becomes 1 		level[id] = tonumber(line[2]) or 1 -- Same as above reasoning (prevents errors) 		money[id] = tonumber(line[3]) or 0 		toexp[id] = tonumber(line[4]) or 10 		admin[id] = tonumber(line[5]) or 0 	else 		msg2(id,"©255000000No USGN found!@C") 		level[id]=1 		toexp[id]=10 		money[id]=0 		exp[id]=0 		admin[id]=0 	end end addhook("say","save_say") function save_say(id,txt) 	if txt=="!reset" then 		menu(id,"Reset your level?,Yes,No") 		parse("sv_sound2 "..id.." menu.wav") 		return 1 	end 	if txt == "!help" then 		msg2(id,"©000255000Server commands:") 		msg2(id,"©100255100!help - see commands") 		msg2(id,"©100255100!reset - reset your level to 1") 		msg2(id,"©100255100!info - See player's level,exp and money") 		return 1 	end end addhook("say","save_sayy") function save_sayy(id,txt) 	_msg=totable(txt) 	_t1=tostring(_msg[1]) 	if txt == "!set_lvl" then 		_t2=tonumber(_msg[2]) 		_t3=tonumber(_msg[3]) 		level[_t2]=_t3 		msg2(_t2,"©000255000Admin set your level to ".._t3.."!@C") 		parse("sv_sound2 ".._t2.." levelup.wav") 		msg("©255075000Admin set "..player(_t2,"name").." level to ".._t3.."!") 	end 	if txt == "!give_lvl" then 		_t2=tonumber(_msg[2]) 		_t3=tonumber(_msg[3]) 		level[_t2]=level[_t2]+_t3 		msg2(_t2,"©000255000Admin give you ".._t3.." levels!@C") 		parse("sv_sound2 ".._t2.." levelup.wav") 		msg("©255075000Admin give "..player(_t2,"name").." ".._t3.." levels!") 	end 	if txt == "!give_adm" and admin[id]==2 and admin[_t2]==0 then 		_t2=tonumber(_msg[2]) 		_t3=tonumber(_msg[3]) 		admin[_t2]=admin[_t2]+1 		msg2(_t2,"©000255000You're admin now!!@C") 		parse("sv_sound2 ".._t2.." levelup.wav") 		msg("©255075000"..player(_t2,"name").." is admin now!") 	end return 1 end addhook("say","save_sayyy") function save_sayyy(id,txt) 	_msg=totable(txt) 	_t1=tostring(_msg[1]) 	if txt == "!info" then 		_t2=tonumber(_msg[2]) 		msg2(id,"©000100255"..player(_t2,"name").." has "..level[_t2].." level , "..exp[_t2].." exp and "..money[_t2].." money.") return 1 	end end addhook("menu","save_menu") function save_menu(id,title,sel) 	if title == "Reset your level?" then 		if sel == 1 then 			msg("©255000000"..player(id,"name").." Has reset level!") 			level[id]=1 			exp[id]=0 		elseif sel == 2 then 			level[id]=level[id] 			exp[id]=exp[id] 		end 	end end