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

How to define a gui in the players view? (all players) Error: PlayerGui not in Players

Asked by 4 years ago
Edited 4 years ago

TextLabel = game.Players.PlayerGui.ScreenGui.TextLabel game.Players.PlayerGui.ScreenGui.TextLabel.Text = "Finished loading! Welcome to " ..game.Name wait(10) for countdown = 10, 0, -1 do TextLabel.Text = "Remaining time: " ..countdown end --I don't know how to make this look like actual code.. sorry

0
What are you trying to do, there is not much reason to reference the playergui. ForeverBrown 356 — 4y

2 answers

Log in to vote
-1
Answered by 4 years ago

just do:

game.StarterGui.ScreenGui.TextLabel.Text = "Finished loading! Welcome to "..game.Name
wait(10)
for countdown = 10,0,-1 do
TextLabel.Text = "Remaining time:"..countdown
end
0
Whatt? why would you change the starterGui? Azure_Kite 885 — 4y
0
That was the problem, I didn't know how to state player's gui. Thanks! Danny_Will 4 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
TextLabel = game.Players.PlayerGui.ScreenGui.TextLabel 

You didnt define the player

it should be

TextLabel = game.Players.[PlayerName].PlayerGui.ScreenGui.TextLabel 

Also click the Lua icon when writing to create a code block thingy like the one i just did

Answer this question