Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Can a Script Access the StarterGui?

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!

3 answers

✓ Accepted answer

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!

1 comment

0

Thanks Turbo!

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

1 comment

0

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

1 comment

0

Thanks Goul!

This discussion is preserved as it was. New answers, comments, and votes are closed.