My first script is having problem. It is confusing. Can you fix it?
Here:
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
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
addhook("say","p_cmd")
admin = {109296}
vip = {}
function Admin(id)
	return table.find(admin, player(id,"usgn"))
end
function VIP(id)
	return table.find(vip, player(id,"usgn"))
end
function PlayerLevel(id)
	if Admin(id) then
		return 5
	elseif VIP(id) then
		return 3
	end
	return 0
end
function p_cmd(id,txt,message)
	if string.sub(txt, 1, 7) == "@freeze" then
		if PlayerLevel(id) >= 5 then
			local p = tonumber(string.match(txt , "@freeze (%d+)"))
			if (p ~= nil) and (player(p,"exist")) then
				parse("speedmod "..p.." -100")
				return 1
			end
		else
			msg2(id,"©125125255ADMINISTRATOR COMMAND")
			return 1
		end
	end
end
In console, it is written:
Quote
[14:44:44] LUA ERROR: sys/lua/first.lua:10: attempt to call field 'find' (a nil value)
The End.
Confuse Script
1 
Offline