Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I fix my intermission?

Asked by 9 years ago
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.

0
Is this a surfacegui? Lacryma 548 — 9y
0
This is my same problem OnaKat 444 — 5y

2 answers

Log in to vote
0
Answered by
Tesouro 407 Moderation Voter
9 years ago

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.

Ad
Log in to vote
0
Answered by
Emg14 10
9 years ago

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

Answer this question