while(true) do wait() if game.Players.NumPlayers >= 3 then for i = 30,0,-1 do wait(1) script.Parent.Text = ("Countdown: "..i) end elseif script.Parent.Text < 3 then script.Parent.Text = ("Waiting for more players") end end
So lets say a random player joins in the middle of this intermission. For a player that has joined earlier, their seconds are for example, at 4 seconds remaining whereas the player that just joined is at 30 seconds. How do I fix it where whether a player joins or resets, the GUI countdown is showing the current countdown for all players.
You can use a Number value placed somewhere all players can access, like Workspace, and make the guis follow it. Also, you need to place a script inside the value, to check if there are more than 3 players and start the countdown.
Also I wanna add, if using while loops pls use either wait(0.1) or just wait(). The computer may crash if loops are used inefficiently and incorrectly. To fix edit this:
while(true) do
To:
while wait(timehere) do
Or just:
while wait() do