This hook doesn't seem to work for me

I have a sandbox server and I am coding stuff on there to learn coding but players can still join,
and some of them asked me to make an buildmode addon.

If the player says !buildmode he gets godmode and it tells him that he has godmode now.

But this hook doesn’t seem to work.

Here is the code
[LUA]
hook.Add(“GM:PlayerShouldTakeDamage”,“ReturnDamageTaker”,function(ply,attacker)
if(attacker:HasGodMode()) then
return false
else
return true
end
end)
[/LUA]

It’s “PlayerShouldTakeDamage”, not “GM:PlayerShouldTakeDamage”. Make sure you’re running this code serverside as well.

[editline]21st February 2017[/editline]

Take a look here: http://wiki.garrysmod.com/page/Hook_Library_Usage

Well thats sad, I thought about that but them I thought it should work.

Thanks it works now :slight_smile: