[HELP] Block Spray (G)

Hello guys!

I want to disable players using Spray in my server
I tried putting this in my : lua/autorun/server
[lua]
hook.Add(“PlayerSpray”, function(ply)
return true
end)
[/lua]
But not working

I tried this too, but still not working :’(

[lua]
function GM:PlayerSpray ( ply )
return true;
end
[/lua]

Could anyone please help me?

goto your cfg/autoexec.cfg

and use these

[lua]
cl_playerspraydisable 1
r_spray_lifetime 0
[/lua]

When you use hook.Add the second parameter must be a unique name.
[lua]hook.Add(“PlayerSpray”, “My Unique Name”, function(ply)
return true
end)[/lua]

The cl_ means that it won’t work in the server.cfg.

What Wh1t3rabbit said should work if you put it into lua/autorun/server/randomname.lua

[lua]
hook.Add(“PlayerSpray”, “sprayRemover”, function()
return true
end)[/lua]

No real need to keep the ply in the function :stuck_out_tongue: