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

Main is not a valid member of PlayerGui.What does that mean?

i made a lobby with game rounds that works perfectly in studio but when i join it doesnt work.I opend server log and it said "Main is not a valid member of PlayerGui". Can someone help me

7 comments

0

It means that Main is not a valid member of PlayerGui.

0

Is there a moderation reason if you didn't put enough effort to solve the problem?

0

It means that the player gui does not have a child named Main.

0

Script?

0

Um only thing i can think of is that main is in the client and you are using a normal script to get it so go to workspace properties and make FilteringEnabled false

0

Thats just bad practice.

0

You probably didn't use WaitForChild. Show the script next time.

1 answer

Two solutions I can think of.

Use WaitForChild.

local main = blah:WaitForChild("Main")
-- don't use a period unless it's referring to properties, like .Parent, in these cases

Use a Local Script.

Yeah. When dealing with UI, use LocalScripts for most of the cases, and whenever you can.

1 comment

0

WTH IS THIS!!!! This is the dumbest script I have ever seen

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