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

Countdown Script not working?

Asked by 9 years ago

Nothing in output.

`countdownNum = 10;

for i = 1,10 do wait(1) game.StarterGui.Msg.TextLabel.Text = (" Starting in : "..countdownNum.. " Seconds...") countdownNum = countdownNum-1 end;`

0
Please format you code in lua code block. Goulstem 8144 — 9y

1 answer

Log in to vote
2
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

Your Problem

Every gui in StarterGui replicates to the client's PlayerGui. So all guis are in players' PlayerGuis. You have to edit them from there! So you'll have to loop through all the players and change their PlayerGuis.


Code

for i = 10,0,-1 do 
    wait(1) ;
    --iterate through players
    for _,v in next, game.Players:GetPlayers() do
        v.PlayerGui.Msg.TextLabel.Text = " Starting in : "..i.. " Seconds...";
    end
end
Ad

Answer this question