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

What's Wrong With This Local Script?

Asked by 10 years ago

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 :)

0
Please Don't Type Like This, It's Unnecessary And Annoying TurboFusion 1821 — 10y
0
I concur with TurboFusion. Please don't capitalize the first letter of EVERY word in your statements. coo1o 227 — 10y

3 answers

Log in to vote
1
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

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

0
I'd also recommend putting it in StarterGui. Shawnyg 4330 — 10y
Ad
Log in to vote
1
Answered by 10 years ago

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

Log in to vote
1
Answered by 10 years ago
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.

Answer this question