Forum

> > CS2D > Scripts > sethook - nil value?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch sethook - nil value?

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt sethook - nil value?

Banaan
User Off Offline

Zitieren
Quite a while ago, I tried using the cs2d lua cmd sethook function. The result, however, was an error: attempt to call global 'sethook' (a nil value). I didn't pay a lot of attention to it then and worked around it.

Today, someone asked me about this very same problem, and I couldn't give an answer to this pretty simple question. So I wrote a little test script to try it out a little:
1
2
3
sethook ("second", 0)
addhook ("second", "func")
function func () print("...") end

Result:
1
LUA ERROR: sys/lua/test3.lua:1: attempt to call global 'sethook' (a nil value)


So am I doing something entirely wrong here, or are there other people with the same problem?

alt Re: sethook - nil value?

Flacko
User Off Offline

Zitieren
Lol, it seems like sethook got fucked up in the last version.
Fortunately, there aren't many scripts that use it.

1
print(type(sethook))
Outputs "nil" instead of "function".

alt Re: sethook - nil value?

GreenDevil
User Off Offline

Zitieren
LOL and i though i could use it for my rtd script Aww man how much time do i need to wait so that i can use it!
Because i want to make a timer ! Disabled > 5 sec > Enabled
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht