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!
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
You're welcome...
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
Thanks Goul!
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Thanks Turbo!