I have 2 functions that i put in a “while true do” loop so they can infinitely make a round based system. However i ran into the problem where after RoundCountdown() it would play again and again.
All Help is appreciated
Here are the lines:
local function RoundCountdown()
local timeleft
if #Players:GetChildren() <= 1 then
InfoLabel.Text = "Waiting for more players..."
task.wait(2.5)
RoundCountdown()
end
for i = 12, 0, -1 do
InfoLabel.Text = "Intermission.."..i
task.wait(1)
end
for i,v in pairs(Players:GetChildren()) do
table.insert(PlayersInRound, v)
v.Character:MoveTo(workspace["The Park"].MapSpawn.Position)
IsInMatch:FireClient(v, true)
end
for i = 5, 0, -1 do
InfoLabel.Text = "Round Starting in "..i.."."
task.wait(1)
end
end
More Lines down:
coroutine.resume(coroutine.create(function()
while true do
RoundCountdown()
StartRound()
task.wait()
end
end))