Programming GUI issue

Screen Shot 2020-11-10 at 11.17.41 AM

1 Like

Also need a picture of your local script inside the “ShopButton”

Very simple.

Did the model worked for you???

script.Parent.Parent.ShopGui.Visible = false – Disappear the gui
script.Parent.Parent.ShopGui.Visible = true – Appear the gui

No, it didn’t, I think I was supposed to change something but i have no idea what.

NEVER MIND LOL.

If you have any other solutions please let me know here.

Okay, could you just send a picture of all local scripts you have functioning for the GUI when a player clicks on the button?

That is the only script other then leaderstats. It was one button, lol.

Okay, can you run me through what you’re trying to accomplish? Because as of right now that function you sent isn’t going to change much.

I think i have to explain everything here:

So, When you click a button
you can use

.MouseButton1Click:Connect(function()
^^ this will creates a function when we click left mouse button!

And your frame can be: script.Parent – this is your frame or other element.

so it should be like:

script.Parent.MouseButton1Click:Connect(function()
   print("Button Clicked!")
end)

And to appear and disappear the ui you could use .Visible

And true means the ui will be seenable
and false means the ui will disappear / can’t be seen

So…
let script.Parent.Frame is your frame that you want to show and hide…

So the code will be

script.Parent.MouseButton1Click:Connect(function()
   script.Parent.Frame.Visible = false  -- Make your gui disappeared or not seenable
  script.Parent.Frame.Visible = true -- Make your gui seenable and visible.
end)

Hope you got the basic concept now!

1 Like

Well originally I was looking for a tutorial, I didn’t have a script to begin with.

Correct me if I’m wrong, by reading this part of the thread,

you want the ‘ShopGui’ image label to disappear when one of those buttons in the ‘Innerlayer’ is pressed and make another frame/menu appear? or… not?

script.Parent.MouseButton1Click:Connect(function()
script.Parent.Frame.Visible = false – Make your gui disappeared or not seenable
script.Parent.Frame.Visible = false – Make your gui seenable and visible.
end)

Let me try that.

1 Like

That is correct, I wasn’t really sure how to explain it;

local ShopGui = script.Parent.Parent.Parent
local Menu2 = script.Parent.Parent.Parent.Parent:FindFirstChild("Menu2Name")

script.Parent.MouseButton1Click:Connect(function()
ShopGui.Visible = false
Menu2.Visible = true
end)

if the other menu is in another gui, please do let me know because I’m a bit confuse on where the other menu is in. By the way, the script can be inserted in any of the buttons of the inner layer such as DailyShopButton or EffectsButton.

Okay so anytime you want a frame to dissapear when the event is called, you want to setup your variables and refence your gui’s that you want to make function.
for the function of a player clicking a mouse button, you want to make sure you state what button when clicked you want the function to call. So in a function
(start off with the clickable button) – so the function only runs when that specific button is clicked.
script.Parent.MouseButtonClick1:Connect(function()
– in here you would use your variable that you created and which gui you want to disappear, set it to, "gui you want to make invisible ".Visible = false
then the gui you want to have appear after clicking the button you simply set the gui or frame to, “.Visible = true”
end)

1 Like

Oops you’re right I deleted it :safety_pin: Let me add it back.

Have you addressed this issue?

1 Like

Yes I am working on it now. I was trying out the other script.