local opened = false
script.Parent.MouseButton1Click:Connect(function()
if opened then
script.Parent.Visible = false
opened = false
else
script.Parent.Visible = true
opened = true
end)
Disclaimer: I didn’t test it so it may have an error in it I didn’t see. But you get the idea.
I assume you have a button and a frame where the shop is. Put this script under the button but change the script.Parent part in the if and else statement to the location of the frame.
script.Parent.Parent.Frame.Visible = false
local opened = false
script.Parent.MouseButton1Click:Connect(function()
if opened then
script.Parent.Parent.Frame.Visible = false
opened = false
else
script.Parent.Parent.Frame.Visible = true
opened = true
end)