--// 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


6 comments

0

What do you mean exactaly by "returning to its beginning"?

0

Unfortunately Lua doesn't support a continue keyword, so you cannot actively reset the loop.

0

Is there a way around this?

0

how to break a for i loop

0

Line 38: break -- break stops the current loop, one at a time, for nested loops, only the innermost will be broken out of

0

u could have a function that runs this loop and make a new thread and check if whatever condition then return nil i guess