Programming GUI issue

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 :stuck_out_tongue:

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.)

Extras - The GUIs I have so far

Screen Shot 2020-11-10 at 10.43.12 AM

I know they aren’t the best, I’m adding more details lol.

6 Likes
local button = script.Parent
local button2 = script.Parent.Parent.ToolBtn
local frame = script.Parent.Parent.Frame
local gui = script.Parent.Parent.Parent.MainGui
button.MouseButton1Click:Connect(funtion()
  frame.Visible = true
  gui.Enabled = true
end)

button2.MouseButton1Click:Connect(funtion()
  frame.Visible = false
  gui.Enabled = false
end)

That easy :wink:

Topic:

If it helped, mark it as solution!

5 Likes

Yeppers! Where exactly do I plug that script into, though?

1 Like

Create a local script. in the button you want to click!

Tutorial: https://www.youtube.com/watch?v=rRMCapw5G_k

2 Likes

Alright! But here is an error I found: Screen Shot 2020-11-10 at 11.02.37 AM

3 Likes

Wait imma make you a example of it…

2 Likes

Here’s a sample/code. Put the code in the button.

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.

2 Likes

Heres the model: ScreenGui - Roblox

Also it seems like you are new to scripting!

anyway welcome to the scripting world! you can learn script at here:

2 Likes

It isn’t meant to be a closer, well it is but I need it to also put the new GUI on. - if that makes sense lol.

You can use the model i’ve gave you.

Yeppers, I am inserting it now. Hold on.

Bare with me here, it might take me a while :skull:

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

Okay, if it works mark it as solution so it will help other people too!!

And if you have any problem you can contact me

By here
And if you want discord: imAlex#4582

1 Like

You forgot to put the c in the word ‘funtion’, it’s supposed to be ‘function’.

Yeah i know. Lol, i already gave him the model. So he can learn from it.

Can you send a full picture of your script? And as well as where the local script is placed.

Like the script that opens the original menu with those buttons?

If you’re talking about the script that you had an error on, then yes.

May I ask if you can send a screenshot of the explorer, to view where you place the frame, buttons and the scripts?

1 Like