for i, v in pairs(CurrentEnemies) do v.Humanoid.HealthChanged:Connect(function() if v.Humanoid.Health <= 0 then print("healthlow") --Add Coin Event table.remove(CurrentEnemies, v) Remaining.Value = Remaining.Value - 1 v:Destroy() end end) end
runs through current enemies and checks if they died
but the .HealthChanged isnt firing.
Try using the get property changed signal:
for i, v in pairs(CurrentEnemies) do v.Humanoid:GetPropertyChangedSignal("Health"):Connect(function() if v.Humanoid.Health <= 0 then print("healthlow") --Add Coin Event table.remove(CurrentEnemies, v) Remaining.Value = Remaining.Value - 1 v:Destroy() end end) end