Issue with a click button to open up

im making a windows xp game and im having issues with a frame to open another frame it may be simple but its more complicated when you see the explorer

so if any of you could help me please

also this is my output when i click it:

Options is not a valid member of Frame “Players.SomeOddYtber2.PlayerGui.Options.BooglesFrame.SearchSuggestion1Page”

Here are some tips:

Make sure you are using a local script

As a general rule, after 5 ancestors, you should switch to the “organic” reference.

--ect
--instead of...
script.Parent.Parent.Parent.Parent --ect
--rather, use
game.Workspace.StartGui --ect

Make sure spelling is correct

i tried

script.Parent.MouseButton1Click:Connect(function()
game.Workspace.StartGui.Options.BooglesFrame.SleepingDogPicFrame.Visible = true
end)

and it did nothing did i do it correctly it is also a local script

Ok, there are multiple problems with what you just said.

  1. Game.StarterGui does not work as it will not actually change what the player sees
  2. script.Parent.etc would work fine and it is not a general rule to do that.

here is what you should do to fix this:

script:FindFirstAncestor("Options").BooglesFrame.SleepingDogPicFrame.Visible = true

The only problem was that there weren’t enough .Parents to get to the options ui.

What did it say in the output?

Game.startergui will work if you make it a local variable

And when I say general rule, t’s so you can organize things better

No, Even if you make it a local variable, it doesn’t change what the player sees and will instead change what the player sees after respawning

thank you and thank you all to who helped me

then it won’t even change what they see at all. Please do some research before trying to correct others.


Here is the official Roblox article on StarterGui As it says, the player’s GUI is emptied on spawn and clones everything in there to their playerGUI. If the resetOnSpawn Property is set to false, the player will not even receive the new change on the GUI. Now, I am done talking about this, but please do not correct others unless you know for a fact it is correct.

I’m sorry, but this actually helps for people not understanding these things, and actually contributes quite a lot to the post, therefore, I will not delete it just because you want it to be deleted because you were incorrect. Flagging it, for this reason, is not right and will not get it taken down.