I am making this intermission system, the for i loop only loops once and then stop (at 24) i dont know why this is happening.
The script is on a server script
function menu()
for i = 25, 0, -1 do
gameGUI.MenuFrame.TextLabel.Text = "Next Round starting in "..tostring(i).." seconds..."
task.wait(1)
end
fadeInLoading()
local started = startMatch()
if started == false then
fadeOutLoading()
menu()
else
startMatch()
end
end
function menu()
for i = 25, 0, -1 do
gameGUI.MenuFrame.TextLabel.Text = "Next Round starting in "..tostring(i).." seconds..."
task.wait(1)
end
fadeInLoading()
local started = startMatch()
if started == false then
fadeOutLoading()
menu()
else
startMatch()
end
end
When the timer reaches 0 (end of the loop) it is going to call the startMatch function, that returns a value. If the player counts is lower than 2, it restarts the timer. Else, it starts the match. However the timer stops at 24.
I dont think that the problem its outside of the function