bin = script.Parent
function Clicked()
bin.Parent.Visible = false
script.Parent.Parent.Visible = false
local Main = script.Parent.Parent.Parent:FindFirstChild("Main")
Main.Visible = true
end
bin.MouseButton1Down:connect(Clicked)
I'd rather do it like this;
local Visible = false
script.Parent:MouseButton1Down:connect(function()
if Visible == true then
Visible = false
script.Parent.Parent.Visible = false
elseif Visible == false then
Visible = true
script.Parent.Parent.Visible = true
end)
The local 'Visible' is because you could use some later on checks to see if the GUI is actually closed or opened.
2 comments
Any more information you could provide?
Try using a textbutton