Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how do i damage all players continuously using the repeat until script?

How do I make all players take continuous damage over time. For example 5 damage every 10 seconds up until they die

1 answer

✓ Accepted answer

If it is continuous then this should work.

game.Players.PlayerAdded:Connect(function(player)
      player.CharacterAdded:Connect(function(char)
            repeat char.Humanoid.Health = char.Humanoid.Health - 5 wait()
            until char.Humanoid.Health = 0
      end)
end)

You may consider adding :FindFirstChild before Humanoid but I would suggest researching that first as I am unsure.

1 comment

1

You need to add a wait or else it won’t be so continuous..

This discussion is preserved as it was. New answers, comments, and votes are closed.