Ive got a swep gun that spawns npc’s. I have it configured for a 5 second delay between “shots” and i have 7 ammo set. But the gun can spawn npc’s without delay an infinite number of times (even though the ammo decreases to 0). Any idea how to fix this?
function SWEP:PrimaryAttack() // This is the position your looking at local eyetrace = self.Owner:GetEyeTrace() self.BaseClass.ShootEffects (self); // The rest is only done on the server if (!SERVER) then return end // Make a fastzombie local ent = ents.Create( "npc_fastzombie" ) ent:SetPos( eyetrace.HitPos ) ent:Spawn() self:TakePrimaryAmmo( 1 ) end