Click GUI to Open GUI

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Hey all! I haven’t developed for about 6 months now, so I need some help! I am trying to make a GUI that opens a GUI when you press it. So basically I will click a TextButton which opens a frame.
  2. What is the issue? Include screenshots / videos if possible!
    I need someone to analyze this script and see what I should add to it to make it happen.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have looked for solutions on YouTube but it only shows “Make GUI Pop Up by clicking Part” So a tutorial from youtube would be nice!
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
function leftClick()
script.Parent.AnyOtherParentsYouNeed.NameOfGui
end

script.Parent.MouseButton1Click:Connect(leftClick)

<— This shows the GUI i want to press.

<----- This is what I want to appear

5 Likes

I’ll try, it thank you for replying! :smiley:

1 Like

why did you put Parent 5 times?

2 Likes

cause if you just go game.StarterGui.Shop.ShopFrame.Visible = true then it won’t pop up. (unless you use playerGui instead)

1 Like

It says “Shop is not a valid member
of player” in the output when I press the TextButton

1 Like

You should probably put the text button in the same gui as the shop to make it less confusing.

1 Like

Remove one parent (There should only be 4 now)

1 Like

Ok I’ll do both of those, @soccervr you mean putting the textbutton into the GUI that is meant to pop up?

1 Like

Like this:

       '''
        script.Parent.MouseButton1Click:Connect(function()
               script.Parent.Parent.Parent.Parent.Parent.Shop.ShopFrame.Visible = true
       end)

           '''

Now it says “ShopFrame is not a valid member of ScreenGUI”

Remove one more… (I’m so stupid lol)

   '''
    script.Parent.MouseButton1Click:Connect(function()
           script.Parent.Parent.Parent.Shop.ShopFrame.Visible = true
   end)

       '''

oh god now its says “Shop is not a valid member of ScreenGui”

You know what:

        '''
           script.Parent.MouseButton1Click:Connect(function()
                   game.Players.LocalPlayer:WaitForChild('PlayerGui').Shop.ShopFrame.Visible = true
            end)

              '''

Sorry for me being stupid

lol connect was spelt connct :wink:

BRUH NOW ITS SHOPFRAME iS noT a valid member of ScreenGui

The local script is a child of a text button correct?

yeah it currently is…

if theres a youtube video can you send it to me?

How did screen gui get there anyway? (In the error) Also, which line?