I have a shop button that opens a menu with a few other buttons that will go to the correct shop, including “gamepasses,” “daily shop,” “effects,” and “featured.” I am trying to make it so that when you click one of the buttons on that menu, another menu pops up and the other menu dissapears.
However, due to my lack of experience / knowledge in the programming category, (obviously) I don’t know how to do that…
I looked up tutorials for “how to make a shop GUI,” but all of them only have the function I have now, a button that opens and closes the shop… I also don’t know what it’s called so there’s that
If someone could tell me at least what that is called, maybe I can find a tutorial that will help me out. If you have any code that could start me out, that would be great as well. (It is my first time designing GUI.)
local button = script.Parent -- The button the player is clicking on
local menu1 = script.Parent.Parent -- Menu that the button is in and the menu that'll disappear
local menu2 = script.Parent.Parent.Parent.Menu2 -- change 'Menu2' to the name of the frame that'll appear.
button.MouseButton1Click:Connect(function() -- Click function
menu1.Visible = false
menu2.Visible = true
end)
if you do want the code for the ‘X’/exit button, please do let me know. If the other menu is in another gui, please let me know so I can change the code.
i`m not gona give you the module, i am gona give you how to do it.
you probaly have a list of buttons somewhere. and if you press any of those buttons things happen
in that list of things you want to add some code that goes trough all the menues, and closes all of them
then let it search for the menu you want to open and make the button open it.
here is the catch tho. if the menu is already open, it only needs to close all menu`s
hope this helps