I have an error with this lua, When I put.. Example: !report 3 speed hacks, I receive an error It is not working well, What is not working well is that the message must appear "Player does not exist" If there is not a player with that ID. Here is code.
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
path = "sys/lua/reports.txt"
pl = {}
addhook("join", "_join")
function _join(id)
pl[id] = {}
pl[id].usgn = player(id,"usgn")
end
addhook("say","_say")
function _say(id, txt)
if txt:sub(1,7)=="!report" then
t = tonumber(txt:sub(8,9))
r = txt:sub(10)
if t~=nil and r~= nil then
if t~=id then
if pl[id].usgn > 0 then
if player(id,"exists") then
if not player(t,"bot") then
if r:len() > 5 then
report(id, t, r)
return 1
else
msg2(id,"\169255150150Error: \169255255255Please enter a valid reason")
return 1
end
else
msg2(id,"\169255150150Error: \169255255255You cannot report a bot")
return 1
end
else
msg2(id,"\169255150150Error: \169255255255Player does not exist")
return 1
end
else
msg2(id,"\169255150150Error: \169255255255You have to be logged into USGN to report a player")
return 1
end
else
msg2(id,"\169255150150Error: \169255255255You cannot report yourself")
return 1
end
else
msg2(id,"\169255150150Usage: \169255255255!report <id> <reason>")
return 1
end
end
end
function report(id, t, r)
f = io.open(path, "a+")
f:write(os.date().. ": "..player(id,"name").." ("..pl[id].usgn..") reported "..player(t,"name").." ("..pl[t].usgn.."|"..player(t,"ip")..") Reason: "..r.."\n")
f:close()
msg2(id,"\169255255255Info: You successfully reported \169175255100"..player(t,"name"))
end
And the error that appears to me
Lua report has error
1 
Offline
Cure Pikachu