GUI Scripting - Need Help with Frames

Hello! Im working on a shop for my game, in which when you touch a part a GUI will pop up.
So, I created this GUI:


The idea is that when the user touches one of the 3 side buttons, it opens a frame that is under the main frame you see in the image and closes the main one. Meaning, I want to open a new section of a UI when I click the 3 frames.

Issues: The 3 side buttons are made of 2 frames (Meaning 6 frames on the side)
I need help making the script that closes the frame and opens the other one.
Note: This is all under the same ScreenGUI. Also, im very bad at scripting so thank you to anyone who reads this topic or tries to help :grinning: !

2 Likes

so what your trying to say, is that you want a new frame to open once a button from the side gets clicked, and closes the main frame?

Yes that was my original intention, though in 3 months I have modified the UI to only 1 frame since I wasn’t able to receive an answer…

so if your trying to make a button that opens a brand new frame, you’ll either have to use instance.new() or create a frame and then toggle off the visibility setting or make transparency 1. and to make the main frame close, you can do mainframe.Visible = false or set transparency to 1 mainframe.Transparency = 1. to sum it all up, you can make a script like:

button1.MouseButton1Click:Connect(function() --change to button name
mainframe.Visible = false --you can change it to transparency or whatever you want
newframe.Visible = true --or do instance.new() and set the properties
end)

and if you need a button to reopen the mainframe you can do:

exitbutton.MouseButton1Click:Connect(function()
newframe.Visible = false
mainframe.Visible = true
end)

let me know if this isn’t what you mean