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
Or if you was to install assmod it comes with that.
function GM:CanPlayerSuicide(ply) ply:ChatPrint("Stuck? Good luck getting out.") return false end
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!
- Go to
- Make a new file called whatever you want.
- Change its file type to .lua.
- Open it with notepad.
- Copy/paste the code.
- Save & Close it.
(7. Launch Gmod
- Use an admin mod to teleport people inside walls and disable noclip
- Have fun with them yelling “WTF AARGH FFFFFFFFFUUU” in the mic.
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
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 end hook.Add( "CanPlayerSuicide", "BlockSuicide", BlockSuicide )