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

How do I make the GUI change words?

Asked by
Zelnus 30
8 years ago

I want the GUI to change words but it just stays the same. How do I make it work?

while wait(1) do
if game.Players.NumPlayers > 1 and (not GameRunning) then
    GameRunning = true
    game.StarterGui.MorePlayers.Frame.TextLabel.Text = "5 Players Needed To Start The Trial"
    wait(2)
    game.StarterGui.MorePlayers.Frame.TextLabel.Text = "Trials Will Begin In 10 Seconds"
    game.Workspace.Beep.Sound:Play()
    wait(1)
end

Don't bother about the other stuff I just need to know how to make the text for the GUI change.

0
Are you testing this with 2+ players? If you want it to work with 1 or more, replace "if game.Players.NumPlayers > 1" with "if game.Players.NumPlayers >= 1". ISellCows 2 — 8y
0
I said not to worry about anything else Zelnus 30 — 8y

1 answer

Log in to vote
1
Answered by
Im_Kritz 334 Moderation Voter
8 years ago

What you are doing is changing the Text in the StarterGui, not in the PlayerGui.

If you want to change the text during gameplay, you got to change it for all players' playerguis.

while wait(1) do
if game.Players.NumPlayers > 1 and (not GameRunning) then
    GameRunning = true
    for _,v in pairs(game:GetService('Players'):GetChildren()) do
            v.PlayerGui.MorePlayers.Frame.TextLabel.Text = "5 Players Needed To Start The Trial"
    end
    wait(2)
        for _,v in pairs(game:GetService('Players'):GetChildren()) do
            v.PlayerGui.MorePlayers.Frame.TextLabel.Text = "5 Players Needed To Start The Trial"
    end
    game.Workspace.Beep.Sound:Play()
    wait(1)
end

0
That didn't work Zelnus 30 — 8y
0
Well, you said don't worry about anything else. I addressed your problem: you aren't suppose to change the StarterGui. Changing anything in there will just be seen by the new players entering the game and the players that died or reset Im_Kritz 334 — 8y
Ad

Answer this question