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

MenuScreen is not a valid member of ScreenGui? [Unsolved]

Okay this is probably the dumbest script in the world but why wont it work. Whenever I test it the console outputs MenuScreen is not a valid member of ScreenGui and it says it is happening on line 3. This is a localscript named MenuScript and it is located inside of a ScreenGui named MenuGUI which is inside of StarterGui, there is another screen GUI but it is not in starterGui it is in serverstorage for another script. Here is the code:

local ScriptParent = script.Parent
local MenuIcon = ScriptParent.MenuButton
local MenuPopUp = ScriptParent.MenuScreen
MenuPopUp.Visible = false

Basically it is suppose to turn MenuScreen invisible but it wont work and it is weird, I can't seem to pick up anything with my eyes so if you have a suggestion to what that error is meaning and why it is happening that would be awesome. (This is just the beginning of the script, this isn't all it will do. I don't want to code anymore until I fix the simple bugs I already come across)

2 answers

✓ Accepted answer

Try naming the locals to something other than the name of the object you are trying to find.

5 comments

0

If that still doesn't work let me know

0

Still getting the same error, I changed the code above to what I now named the variables. Please tell me if these still are too similar.

0

A couple things... is your "MenuScreen" directly inside of script.Parent? Try script.Parent.MenuScreen.Visible = false. Also, try doing ScriptParent:WaitForChild("MenuScreen") ... this will pause the script until MenuScreen has been found. Let me know if you are still getting errors.

0

Hahaha, maybe I should open my eyes more often. MenuScreen is nothing I have no clue why I was searching for that, changed it to the proper item and works just fine, thanks!

0

You are welcome! I'm glad I could help! I'm glad you got this figured out!

If it is in starter GUI it will go into the players gui when they log on so you need to change that.

4 comments

0

Something like script.parent?

0

ya

0

Still getting the same error

0

Like I have said I do have another GUI named StartingScreen located in ServerStorage if that means anything.

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