I am working on minigames game and I need help with loops. So I have while true do and inside is for i loop then end of for loop and game script. But when timer says 0 timer will reset and start again from 10. I tried everything, please help. Sorry for mistakes in code below but in a studio is everything okay.
Code: local GameStatus = rep:FindFirstChild("Values"):FindFirstChild("GameStatus") game.Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function(Character) --Loop-- while true do local count = 10 for i = 1,10 do if count == 1 then GameStatus.Value = "The next map will be chosen in 1 second" else GameStatus.Value = "The next map will be chosen in "..count.." seconds!" end count = count -1 wait(1) if count == 0 then break end end
----Next is map choosing and teleporting players--
end--End of the loop-- end)--End of character added-- end)--End of player added