Block Spray (G)

Hello guys!

Can anyone help me out?!
I need a script to block spray…

I tried this one but it’s not working :frowning:

function GM:PlayerSpray(Player)

Player:ChatPrint("You can't spray!")
return true


Hook the function.

I already tried this but it’s not working ! please help me

hook.Add(“PlayerSpray”, function(ply)

ply:ChatPrint("You aren't allowed to use sprays!")
return true


Even has an example of making it admin only.