I am making a shop GUI in my game and I've made the button to open it and a button on the ScrollingFrame itself, and when I click the close button, the Open shop button won't work.
Code for the Open Button:
local object = script.Parent.Parent.Parent.ScrollingFrame
object.AnchorPoint = Vector2.new(0.5, 0.5)
object.Position = UDim2.new(-1, 0, 0.5, 0)
script.Parent.MouseButton1Click:Connect(function()
object:TweenPosition(UDim2.new(0.5, 0, 0.5, 0))
end)
Code for the Close Button:
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Visible = false
end)
I am quite new to scripting so please don't talk about my poor coding skills :)

2 comments
When you click the button the first time, you move the "object" to the position given, the other times you click the button, it's already at that position so nothing changes
Have you tried tweening it back to the original position rather than just making the GUI invisible? If you're trying to achieve a fluent shop animation, it'd only make sense to do so.