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:

[lua]
function GM:PlayerSpray(Player)

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

end
[/lua]

Hook the function.

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

[lua]
hook.Add(“PlayerSpray”, function(ply)

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

end)
[/lua]

Even has an example of making it admin only.