I am working on a game and I would like to know how to make an image label GUI that is already false, visible through a script. Is it something like,
game.StarterGui.ScreenGui.ImageLabel.Visible = true
Or do you do it differently? Please let me know some ways to do this.
You can't get the StarterGui
as everything there is cloned to the PlayerGui
as soon as the player joins. Therefore, you must add a Player:WaitForChild("PlayerGui") in your script.
Your correct code would be:
local player = game.Players.LocalPlayer -- To make things easier.. player:WaitForChild("PlayerGui").ScreenGui.ImageLabel.Visible = true -- We have got the PlayerGui instead of the StarterGui and added a :WaitForChild to make sure it is there before the script activates..
Also, make sure this is local, if not you will have to use :FireClient() to make it work.