Can a script in the Workspace access the StarterGui? For example:
game.StarterGui.ScreenGui.TextButton.Visible = true
If not, what would you have to do to fix it? Thanks!
Yes, a script can access the StarterGui
, but making changes in the StarterGui
won't change the Gui's that a player is seeing. Any changes to gui's in the StarterGui
will only change the gui's the appear when the player respawns.
If you want the script to be able to change a player's gui, use this directory instead: game.Players.LocalPlayer.PlayerGui
. After PlayerGui
, you can put the rest of the gui code.
NOTE: Make sure that code is in a localscript, or else it won't work
Hope this helped!
Yes, a script can access the StarterGui, but I wouldn't recommend doing so in-game. The StarterGui is just the template that gets copied into the player's PlayerGui's.
Scripts inside the StarterGui should be used to access player's individual Gui's. Therefore, you wouldn't want to go to the StarterGui to change things such as a TextButton.
For more about the StarterGui
For more about the PlayerGui
Yes, but the guis you see in-game are stored in your player's PlayerGui
.. not StarterGui. So to change how something looks for the client you need to access the gui through their PlayerGui.
Ex;
local plr plr.PlayerGui.ScreenGui.TextButton.Visible = true
Locked by Goulstem and EzraNehemiah_TF2
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?