Im trying to open a shop with a button once the shop is open you can close it with that same button. I tried to attempt doing that but it didn't work; here is the script i used: i used this in a local script
local open = script.Parent.Parent.Open
open.Value = true
script.Parent.MouseButton1Click:Connect(function(click)
script.Parent.Parent:TweenPosition(UDim2.new(-0.111, 0,0.211, 0),true)
wait()
script.Parent.Text = ">>"
open.Value = false
end)
wait()
if open.Value == false then
script.Parent.MouseButton1Click:Connect(function(click)
open.Value = true
script.Parent.Parent:TweenPosition(UDim2.new(0, 0,0.211, 0),true)
wait()
script.Parent.Text = "<<"
end)
end

1 comment
put lines 13-20 inside the script.Parent.MouseButton1click