DarkRP respawner (Need help)

Hello!

I’m pretty new to lua, but I’m getting better and better… I have a problem with a very simple code atm…


local function unstuck( ply, text)
	if(string.sub ( text, 1, 6) == "!stuck" ) then
		if ply:Alive() then
			ply:Kill()
			ply:Spawn()
			PrintMessage( HUD_PRINTTALK, "Player: "..ply:Nick().." was respawned by using the !stuck command.")
		end
	end
end

Any ideas why this will not work? I can really not see what’s wrong with it… Thanks!

Do you hook PlayerSay?

Hmmm… I will give it a try!

[editline]2nd December 2013[/editline]

I forgot to add the hook… Thanks for the help man! Solved