Saying: Main is not a valid member of PlayerGui
I need help with a player GUI Error, saying Main is not part of PlayerGui?
1 answer
If this is in a localscript, doing that won't affect the other players, you need to use a remote event (:FireAllClients) in order to do that.
If it's a serverscript, playergui is not visible for the server.
13 comments
Also, use WaitForChild on PlayerGui as it might be nil.
So how can I access the playerGui to change something inside it?
You need to use a remoteevent.
How do I do that? I want to access main, http://prntscr.com/l4i8y1
You simply google "roblox remoteevent", the method is :FireAllClients().
How would I write it into code so I could access the text?
The wiki will tell you everything you need to know.
I can't find the page, may I have the link/
Yes you can, here: https://www.robloxdev.com/api-reference/class/RemoteEvent
Thank you but this still doesn't help me with my problem. I want to access a GUI part from the Player, but it gives me an error message of the part I'm trying to access is not there when the GUI is.
Use WaitForChild on the object you're accessing to make sure it's there.
It still says it's not a valid member when I do v.StarterGui.Main:WaitForChild()
Oh.. my get players function might be wrong http://prntscr.com/l4ihst
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Are you sure that Main is a parent of PlayerGui?