Forum

> > CS2D > Scripts > Tibia error
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Tibia error

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Tibia error

Angel Montez
BANNED Off Offline

Zitieren
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 >

alt Re: Tibia error

TrialAndError
User Off Offline

Zitieren
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.

alt Re: Tibia error

Dousea
User Off Offline

Zitieren
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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht