Okay, let me know if it’s working. Or if it’s not functioning the way you want it to.
Shouldn’t that work…? I referenced the parent of the script, then the ShopGui…
Well according to your workspace, your shop gui isn’t correctly referenced.
it should be
script.Parent.ShopGui.Visible = "True or false"
It depends on where you put the script.
I can show the explorer tab if that helps.
ohhh okay.
Just honestly set up your variables before the function. It’ll be much more efficient and easier.
--variables
local shopGui = game.Workspace.StarterGui.MainGui.ShopGui
--now inside your function you should put,
shopGui.Visible = false
The startergui is in the workspace…?
actually instead of doing game.workspace, do
local playerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local mainGui = playerGui:WaitForChild("MainGui")
local shopGui = mainGui.ShopGui
--then inside your function
shopGui.Visible = false
Use those variables instead, so it only changes the client gui properties.
Test that and run it, see if it makes the shopGui disappear.
After clicking on the button
Yes it does! Now it just needs to show the new Gui, which I think I can do.
It should have the same function but just make “Visible” true?
Cool, just make sure you first name the variable of the frame you want to open after clicking. Then you just set that gui you referenced to .Visible = true inside the same function we just went over.
Make one button set the visible property of the gui to true and the other, to false.
Yes, however… once you make the shopGui.Visible = false, it’ll stay false unless told otherwise.
So if you wanted the shopGui to go back to visible again, I would try and figure at what point you want to make the shopGui visible again, then use a function similar to the one we created and simply set the visibilty of the shopGui to true. Otherwise it won’t function as neatly
If I were you, I would set the visibility of your unwanted GUI’s to false when a certain menu is opened. Then if another menu is opened simply set the visibility of the previous menu that is visible to false, same with unwanted GUI’s. And if you close shop in total, you can set the visibilty of all other gui’s to false except for shopGui. This will make it look much more authentic. You will need to include multiple local scripts in correct areas to accomplish this, but end up running simple code. You can even add tweening animations to make your shop animate when it’s opened or closed.
That was the original way I did it; also I am trying to understand what variable I change…
Cool, just make sure you first name the variable of the frame you want to open after clicking.
Which frame do you want to make visible when the button is clicked?