Hello! I maked this simple timer but I don't how can I break this loop if will be just 2 players on the game. Anyone know what can I add?
while true do
t = 10
repeat
t = t-1
s.Value = "Time Left: " ..t
wait(1)
until t==0
end
Hello! I maked this simple timer but I don't how can I break this loop if will be just 2 players on the game. Anyone know what can I add?
while true do
t = 10
repeat
t = t-1
s.Value = "Time Left: " ..t
wait(1)
until t==0
end
Place all of this in the spot where you want to break.
local bruh = game.Players:GetChildren()
if #bruh >= 2 then
break
end
Be more descriptive with your answers
Nice, it works, thank you!
"bruh"
lol
also use game.Players:GetPlayers() instead
Downvoted because this doesn't use the condition part of the repeat loop, bad variable names, not actually solving the question (it will exit the loop if there's more than 1 player and not just if there's 2 players), and usage of GetChildren instead of GetPlayers
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Use the condition part of the repeat loop