FireBullets, Nextbots shooting at each other?

i made a bot that can shoot at the player, using the ShootBullets function, and while it works perfectly when i spawn one bot, things start to get weird if i spawn more than one.

using this as my bullet table:


self.ang = (self:GetEnemy():GetPos() - self:GetPos()):GetNormalized():Angle()
	
	--print(self:GetEnemy())
	   
             bullet = {}
		bullet.Attacker = self
		bullet.HullSize = 2
                bullet.Num = 1
                bullet.Src = self:EyePos()   
                bullet.Dir = self.ang:Forward()  
                bullet.Spread = Vector( .4, .4, 0)
                bullet.Tracer = 1
                bullet.TracerName    = "Tracer"
                bullet.Force = 20
                bullet.Damage = 4
		bullet.Distance = 450
                bullet.AmmoType = "Pistol"
				
	

If i spawn one, the bullets come from my bot, directly at me, with the inaccuracy that bullet.Spread defines.

However, if i have more than one of this type of bot spawned, the bullets fired from one bot fly straight towards another, despite them aiming at me. The bullets here also ignore bullet.Spread, and fire with perfect accuracy. The Bots end up killing each other without damaging me at all.

anyone have an idea why this is happening?



bullet = {}


This is your issue. Localize it.

I can’t believe i overlooked that, Thanks!