LUA ERROR: sys/lua/cs2dtibia/hooks.lua:135: attempt to call global 'func' (a nil value)
-> sys/lua/cs2dtibia/hooks.lua:135: in function <sys/lua/cs2dtibia/hooks.lua:121>
-> in Lua hook 'say', params: 1, '!help'
Spoiler
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
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
addhook("say","EXPsay",-10) function EXPsay(id,words) 	if PLAYERS[id].tmp.exhaust.talk then return 1 end 	PLAYERS[id].tmp.exhaust.talk = true 	addtimer(CONFIG.EXHAUST.TALK, rawset, PLAYERS[id].tmp.exhaust, "talk", false) 	if words:sub(1,1) == '!' then 		command = words:sub(2):split(' ') 		--help command fix 		if command[1] == "help" then 			message(id, "The commands are : ") 			message(id, "help, ") 			for i, v in pairs(COMMANDS) do 				message(id, i .. ", ") 			end 				table.remove(command,1) 				func(id,command) 		else 			local func = COMMANDS[command[1]] 			if func then 				table.remove(command,1) 				func(id,command) 			end 		end 		return 1 	end 	if not PLAYERS[id].Tutorial.say then 		message(id, "Talking! I don't think you need a tutorial on that, but just to let you know, whatever you say can only be heard by people around you.", "255128000") 		PLAYERS[id].Tutorial.say = true 	end 	local picture = 'gfx/weiwen/talk.png' 	words = words:gsub('%s+', ' ') 	local radiusx, radiusy, colour, action 	if words:sub(-1) == '!' then 		words = words:upper() 		action = "yells" 		radiusx, radiusy = 1280, 960 	elseif words:sub(-1) == '?' then 		action = "asks" 		picture = 'gfx/weiwen/ask.png' 	elseif words:sub(1,2) == '::' then 		words = words:sub(3) 		action = "whispers" 		radiusx, radiusy = 48, 48 	end 	if words:find':D' or words:find'=D' or words:find':)' or words:find'=)' or words:find'%(:' or words:find'%(=' or words:find'xD' or words:find'lol' then 		picture = 'gfx/weiwen/happy.png' 	elseif words:find'>:%(' or words:find':@' or words:find'fuck' or words:find'shit' or words:find'ass' then 		picture = 'gfx/weiwen/angry.png' 	elseif words:find':%(' or words:find'=%(' or words:find'):' or words:find'):' or words:find':\'%(' or words:find':<' then 		picture = 'gfx/weiwen/sad.png' 	end 	addtimer(1000, freeimage, image(picture, 0, 0, 200+id)) 	local code = words:lower() 	if code:sub(1,1) == '^' then 		colour = CONFIG.COLOURS[code:sub(2,2)] 	end 	if player(id,"team") == 0 then 		radiusx, radiusy = 0, 0 	end 	local text = string.format("©%s %s %s %s : %s", colour or "255255100", os.date'%X', player(id, "name"), action or "says", words) 	text = "©" .. (colour or "255255100") .. os.date'%X' .. " " .. player(id, "name") .. " " .. (action or "says") .. " : " .. words 	radiusmsg(text, player(id, 'x'), player(id, 'y'), radiusx, radiusy) 	return 1 end