How do you disable the kill command?

Hi guys Is there some sort of way too disable the kill and explode console commands on a Gmod server? Thanks

With lua. I’d give you a small lua script but I don’t know how to do it myself.

For Kill, here’s an example.

[lua]function GM:CanPlayerSuicide( pl )
//Whatever goes here
return false;

Or if you was to install assmod it comes with that.

function GM:CanPlayerSuicide(ply)
	ply:ChatPrint("Stuck? Good luck getting out.")
	return false

God I hate that :V
Now that I think about it, I did know how to make that. I just didn’t think of the CanPlayerSuicide thing and I was thinking about blocking the console command itself (Which I don’t know how to do… yet).


Hey we didn’t tell him where to put it!

  1. Go to


  1. Make a new file called whatever you want.
  2. Change its file type to .lua.
  3. Open it with notepad.
  4. Copy/paste the code.
  5. Save & Close it.
    (7. Launch Gmod
  6. Use an admin mod to teleport people inside walls and disable noclip
  7. Have fun with them yelling “WTF AARGH FFFFFFFFFUUU” in the mic.
  8. ???
  9. Profit)

Didn’t work.


what do i do now?


what do i do ? if its not working

You don’t need to quote the same thing twice. Are you sure you changed its file type to .lua?

Wait never mind I can fix it for you.

Just put that in your main GMod directory

Its still not working :slight_smile:

Testing it myself.


You’re right. Didn’t work. But I fixed it. Copy/paste this into the file:

local function BlockSuicide(ply)
	ply:ChatPrint("Stuck? Good luck getting out.")
	return false
hook.Add( "CanPlayerSuicide", "BlockSuicide", BlockSuicide )