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

accessing player gui from workspace?

hi guys, I am trying to access the local players startergui from a script in workspace, is this possible? I'm trying to change the text in a gui but the script has to be in workspace please help I have no idea how to do this

1 comment

0

What entails the script to have to be in the workspace? Perhaps you could reference a value from the client that is assigned on the server.

1 answer

✓ Accepted answer

You cannot access LocalPlayer unless the script is a LocalScript, but I recommend this (this is a Script):

game.Players.PlayerAdded:connect(function(p) -- when a player joins
	local gui = p.PlayerGui --gets the 'startergui' of a player
end)

2 comments

0

thank you

0

The PlayerGui doesn't load straight away so I suggest adding WaitForChild on line two to prevent errors like this: "PlayerGui isn't a valid member of Player" from happening.

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