halo.Add doesn't seem to work for me

simple question, this doesn’t seem to be giving the enemies a halo, nothing happens. The end result is supposed to give every enemy a red halo that can be seen through walls when there are only 5 or less in a round, left.
The class names of the enemies are “nut_zombie” and “nut_zombie_sprint”
[lua]if (nz.Rounds.Data.MaxZombies - nz.Rounds.Data.KilledZombies <= 5) and (nz.Rounds.Data.HalosYet == 0) then
nz.Rounds.Data.HalosYet = 1
halo.Add( ents.FindByClass( “nut_zombie*” ), Color( 255, 0, 0 ), 5, 5, 1, true, true )
end[/lua]

nz.Rounds.Data.HalosYet is being initialized with a value of 0 somewhere else, so I don’t think thats the problem.

Add a print above the halo and see if it gets there.
And use it in a hook, example

halo.Add

Ahh, I think the issue is that I wasn’t using it in the hook. Thanks a lot!

edit:
getting this error
[ERROR] gamemodes/nzombies3/gamemode/enemies/sv_hooks.lua:54: attempt to index global ‘halo’ (a nil value)

[lua]hook.Add( “PreDrawHalos”, “AddHalos”, function()
nz.Rounds.Data.HalosYet = 1
halo.Add( ents.FindByClass( “nut_zombie*” ), Color( 255, 0, 0 ), 5, 5, 1, true, true ) --this is line 54
print(“Halos added successfully”)
end )[/lua]

Are you doing it serversided? this is a clientsided command.

I was doing it sv side, -.- oops lol, thanks a lot