--// Varibles \\--
local Count = 30
local repStorage = game:GetService("ReplicatedStorage")
local TextValue = repStorage.TextValue
local ServerStorage = game:GetService("ServerStorage")
local MapsFolder = ServerStorage.Maps
local RoundTime = 60
local RoundActive = false
--// Loops \\--
while true do
for i = 1,30
do
wait(1)
TextValue.Value = ("Instermission "..Count)
Count = Count - 1
end
Count = 30
TextValue.Value = "Round Starting..."
MapsFolder.Map1:Clone().Parent = workspace.Map
wait(3)
TextValue.Value = "Teleporting Players"
for i,player in pairs (game.Players:GetPlayers()) do
repStorage.PlayerCount.Value = repStorage.PlayerCount.Value + 1
player.Character.HumanoidRootPart.Position = Vector3.new(3, 33, 15)
player.Character.HumanoidRootPart.Anchored = true
player.TeamColor = BrickColor.new("Really red")
wait(3)
player.Character.HumanoidRootPart.Anchored = false
end
RoundActive = true
for i = 1 , 60
do
if repStorage.PlayerCount.Value > 1 then
wait(1)
TextValue.Value = ("Round in progess "..RoundTime)
RoundTime = RoundTime - 1
else if repStorage.PlayerCount.Value == 1 then
-- goes back to the beging of the loop?
end
RoundTime = 120
workspace.Map.Map1:Destroy()
end
end
end
COMMUNITY QUESTION
how to return a loop to its begining?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
What do you mean exactaly by "returning to its beginning"?
Unfortunately Lua doesn't support a continue keyword, so you cannot actively reset the loop.
Is there a way around this?
how to break a for i loop
Line 38: break -- break stops the current loop, one at a time, for nested loops, only the innermost will be broken out of
u could have a function that runs this loop and make a new thread and check if whatever condition then return nil i guess