Freeze Zombie when spawned

Hello as you know I am coding a GM called Zombie escape based on the CS:S
version. To make it work I need this code to work. But it does not seem to do it’s job when it goes into my GM.

function ZombieSpawn( ply)
self.BaseClass:ZombieSpawn(ply)
if ply:Team() == TEAM_DEATH then
ply:PlayerSpawning(true)
ply:Freeze()
ply:GodEnable()
ply:SetColor(0, 0, 255, 125)
ply:PrintMessage( HUD_PRINTTALK, “You are protected for 15 seconds to give time for humans to run!”)
local function DoIt()
ply:Give(“weapon_real_cs_knife2”)
ply:GodDisable()
ply:UnFreeze()
end
timer.Simple(15, DoIt)
end
end
hook.Add(“PlayerSpawn”, “ZombieSpawn”, ZombieSpawn)

[lua]
hook.Add(“PlayerSpawn”, “ZombieSpawn”, ZombieSpaw
[/lua]
You forgot an “n” and a bracket “)”.

Should be
[lua]
hook.Add(“PlayerSpawn”, “ZombieSpawn”, ZombieSpawn )
[/lua]

The gamemode you’re basing it off of has a function named ZombieSpawn()?

Still it does not work… Yes it does

Are you calling from Client or Server?

server init.lua

[lua]–Boolean true/false
ply:Freeze(true) --freezes dem
ply:Freeze(false) – well duhhh
[/lua]

Thanks!

ply:Lock() and ply:UnLock() are better because of locking input, therefore keypresses aren’t called. :pseudo:

I see