Forum

> > CS2D > Scripts > Tibia error
Forums overviewCS2D overview Scripts overviewLog in to reply

English Tibia error

3 replies
To the start Previous 1 Next To the start

old Tibia error

Angel Montez
BANNED Off Offline

Quote
error say !help plz

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 >

old Re: Tibia error

TrialAndError
User Off Offline

Quote
func(id,command)
Is there any function that is called func in your code? If so, make sure it's not "local" in another file, so it can be accessed.

old Re: Tibia error

Dousea
User Off Offline

Quote
Replace line 15-16 with line 18-21. So the code will be (from line 15)
1
2
3
4
5
6
7
8
9
10
11
12
local func = COMMANDS[command[1]]
               if func then
                    table.remove(command,1)
                    func(id,command)
               end
          else
               local func = COMMANDS[command[1]]
               if func then
                    table.remove(command,1)
                    func(id,command)
               end
          end
It's not optimal, at all, but that should do it. Well as a suggestion, read thread cs2d [GUIDE] Lua errors meanings for better understanding on Lua errors.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview