Problem with intermission countdown on test

Hi! I’m making a Intermission countdown for my game and i have a problem, when on a Local Server with 2 players, the intermission only start in the account that joined first, and after the first intermission finish, the other account appear the intermission but it’s 0 and go to negative and don’t stop.

Here the code (server script) :

function intermission()
	local intermissionLength = 15
	local intermissionCount = intermissionLength

	for i, players in pairs(players:GetChildren()) do
		repeat
			intermissionCount = intermissionCount - 1
			players.PlayerGui.RoundGui.RoundInfoLabel.Text = "Intermission: ".. intermissionCount .." seconds left!"
			wait(1)
		until intermissionCount == 0
	end
	
	if intermissionCount == 0 then return end
end

Here few images :
(first joined)


Now the first joined intermission finish and :

Hope you can help me!

2 Likes

Try this instead:

function intermission()
local intermissionLength = 15
local intermissionCount = intermissionLength
repeat
intermissionCount = intermissionCount - 1
for i, players in pairs(players:GetChildren()) do
players.PlayerGui.RoundGui.RoundInfoLabel.Text = “Intermission: “… intermissionCount …” seconds left!”
end
wait(1)
until intermissionCount == 0
if intermissionCount == 0 then return end
end

1 Like

Work! Thank you :slight_smile: