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

What's Wrong With This Local Script?

I Tried To Make The Text Change While The Local Script Is In The Workspace And While The Game Is Running But The Script Won't Work Anyone Help?? :)

Gui = game.Workspace.Players.LocalPlayer.PlayerGui

while true do
Gui.GameText.Frame.TextOfGame.Text = "Waiting For More Players."
wait(.5)
Gui.GameText.Frame.TextOfGame.Text = "Waiting For More Players.."
wait(.5)
Gui.GameText.Frame.TextOfGame.Text = "Waiting For More Players..."
wait(.1)
end

Thanks :)

2 comments

0

Please Don't Type Like This, It's Unnecessary And Annoying

0

I concur with TurboFusion. Please don't capitalize the first letter of EVERY word in your statements.

3 answers

✓ Accepted answer

Players is not a descendant of Workspace. Also, this script should be a descendant of StarterGui.

Gui = game.Players.LocalPlayer.PlayerGui

while true do
Gui.GameText.Frame.TextOfGame.Text = "Waiting For More Players."
wait(.5)
Gui.GameText.Frame.TextOfGame.Text = "Waiting For More Players.."
wait(.5)
Gui.GameText.Frame.TextOfGame.Text = "Waiting For More Players..."
wait(.1)
end

1 comment

0

I'd also recommend putting it in StarterGui.

LocalScripts will never run from the Workspace, they will only run from a client. Put the localscript in the player for it to work.

Gui = gamePlayers.LocalPlayer.PlayerGui -- Can't get Players from Workspace

while true do
	Gui.GameText.Frame.TextOfGame.Text = "Waiting For More Players."
	wait(.5)
	Gui.GameText.Frame.TextOfGame.Text = "Waiting For More Players.."
	wait(.5)
	Gui.GameText.Frame.TextOfGame.Text = "Waiting For More Players..."
	wait(.1)
end

Your problem is one, the script needs to be inside StarterGui, and two the gui variable can't access Players and LocalPlayer from the Workspace. Hope I helped and remember to rate up.

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