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)
You switched up lines 08 and 11, don't worry, it happens to everyone.