Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 5 years ago

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

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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
You need to add a wait or else it won’t be so continuous.. sahadeed 87 — 5y
Ad

Answer this question