I found this somewhere on Facepunch from a few years ago:
[code]
function GM:CanPlayerSuicide(ply)
return false
end
[/code]
I put that in a file named antisuicide.lua in lua/autorun/server/ but its not working. I can still suicide though... Whats up?
Do I need some sort of hook?
You can't call the gamemode table outside of the gamemode.
Replace the code with this instead:
[lua]
hook.Add("CanPlayerSuicide", "antisuicide", function( ply )
return false
end)
[/lua]
Sorry, you need to Log In to post a reply to this thread.