Let me be more specific.
My script has this variable
local textLabel = game.StarterGui.ScreenGui.TextLabel
but when it runs lines like
textLabel.Text = "Making map,please wait..."
it doesn't work. Am I doing something wrong here?
Let me be more specific.
My script has this variable
local textLabel = game.StarterGui.ScreenGui.TextLabel
but when it runs lines like
textLabel.Text = "Making map,please wait..."
it doesn't work. Am I doing something wrong here?
This is because you change the StarterGui's Gui, instead of the player's PlayerGui.
From a localscript you can do this (presuming you have a ScreenGui with default name in StarterGui):
wait()
local LocalPlayer = game.Players.LocalPlayer
local PlayerGui = LocalPlayer.PlayerGui
local ScreenGui = PlayerGui:FindFirstChild("ScreenGui")
local TextLabel = ScreenGui:FindFirstChild("Text");
TextLabel.Text = "Making map, please wait.."
-- Or, if you want it simple;
game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel.Text = "Making map, please wait"
oh, thank you so much for explaining!
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
game.StarterGui.ScreenGui.TextLabeltogame.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel