So I am making a GUI shop for my game but when I am trying to make an open/close script, it never seems to work. Am I missing something or doing something wrong? Here is what my localscript contains:
local button = game.StarterGui.Shop.openclose.openclose
local Opened = false
local ShopFrame = button.Parent.Parent.main
button.MouseButton1Click:Connect(function()
if Opened == false then
ShopFrame.Visible = true
Opened = true
else
ShopFrame.Visible = false
Opened = false
end
end)
Answer: Basically I changed the script so it would work. This is what I got:
local frame = script.Parent.Parent.main
local open = false
script.Parent.openclose.MouseButton1Click:connect(function()
if frame.Visible == false then
frame.Visible = true
else
frame.Visible = false
end
end)

3 comments
Thanks but for some reason, it still won't open.
Hmm. Select it in test mode's explorer, click the button. Does it change it's Visible property? Put a print after line 05 and see if it reaches that point?
It's already solved clc02 but thanks for trying!