Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make the GUI change words?

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.

2 comments

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".

0

I said not to worry about anything else

1 answer

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

2 comments

0

That didn't work

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

This discussion is preserved as it was. New answers, comments, and votes are closed.