I got nil when i want to check if the hook works.
1
2
3
4
5
2
3
4
5
addhook("spray","test")
function test(p)
msg(p) -- Got nil?
end
Scripts
Lua Scripts/Questions/Helpaddhook("spray","test")
function test(p)
msg(p) -- Got nil?
end
addhook("spray","test")
function test(p)
msg(p) -- Got nil?
end
addhook("spray","test")
function test(p)
parse("msg "..p")
end
addhook("join","nickjoin")
addhook("spawn","pspawn")
function nickjoin(p)
function pspawn(p)
n = player(p,"name")
if n=="Player" then
parse("setname "..p.." [ByKaka] Guest")
end
end
end

addhook("join", "nameact")
addhook("spawn", "nameact")
function nameact(p)
	if (player(p, "name")=="Player") then parse("setname "..p.." [ByKaka] Guest") end
end
--Simple Assertion--
function error(t)
	msg("Error:"..t)
end
function assert(o, _o, op)
	if op == "=" then
		if not (o == _o) then error("AssertionException: Equality failed.") end
	end
	if op == "!=" then
		if (o == _o) then error("AssertionException: Inequality failed.") end
	end
	return true
end
function namesec()
	for n=1, 32 do
		if player(n, "exists") then assert(player(n, "name"), "Player", "!=") end
	end
end
addhook("second", "namesec")
if filter("this is normal speech") then print("error") end
if not (type(first) == "string") then return t end 	if not (type(last) == "string") then return t end