So i am trying to make this like a explosion damage thats only one time but somehow its doing it repeatedly, anyway to make it so it gets all the zombies in range just take 30 damage? instead of it doing it in a fast loop.
for i, v in pairs(enemies:GetChildren()) do
local distance = (v.Torso.Position - script.Parent.Position).Magnitude
if distance < 24 and debounce == false then
v.Zombie.Health =- 30
--script.Parent.ExplosionEffect.Enabled = true
script.Parent.Transparency = 1
-- script.Parent.Explosion.Visible = true
script.Parent.EXP_Triggered.Value = true
script.Parent.Triggered.Value = false
print('Dealt 30 DMG to ', v.Zombie.Name)
print(distance)
end
print(distance, ' distance to ', v.Zombie.Parent.Name)
end
debounce = true
wait(9999999999999999)