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