local r=shopFrame.Size isOpen.Changed:Connect(function()if isOpen.Value==true then shopFrame.Visible=true shopFrame.Size=UDim2.new(0,0,0,0)local f=TweenInfo.new(.15,Enum.EasingStyle.Linear)local a={Size=r}local m=ts:Create(shopFrame,f,a)m:Play()shopBtn.TextLabel.Text="\067\108\111\115\101 \083\104\111\112"elseif isOpen.Value==false then local r=TweenInfo.new(.15,Enum.EasingStyle.Linear)local f={Size=UDim2.new(0,0,0,0)}local a=ts:Create(shopFrame,r,f)a:Play()a.Completed:Connect(function()shopFrame.Visible=false shopBtn.TextLabel.Text="\066\117\121 \067\097\115\104\033"end)end end)shopBtn.MouseButton1Click:Connect(function()if isOpen.Value==true then isOpen.Value=false elseif isOpen.Value==false then isOpen.Value=true end end)

local initialShopSize = shopFrame.Size

isOpen.Changed:Connect(function()
	if isOpen.Value == true then
		-- open

		shopFrame.Visible = true
		shopFrame.Size = UDim2.new(0,0,0,0)

		local shopTweenInfo = TweenInfo.new(0.15, Enum.EasingStyle.Linear)
		local shopTweenGoal = {
			Size = initialShopSize
		}

		local shopTween = ts:Create(shopFrame, shopTweenInfo, shopTweenGoal)
		shopTween:Play()
		shopBtn.TextLabel.Text = "Close Shop"
	elseif isOpen.Value == false then
		-- close

		local shopTweenInfo = TweenInfo.new(0.15, Enum.EasingStyle.Linear)
		local shopTweenGoal = {
			Size = UDim2.new(0,0,0,0)
		}

		local shopTween = ts:Create(shopFrame, shopTweenInfo, shopTweenGoal)
		shopTween:Play()
		-- When the Tween has finished, the shop frame is hidden.
		shopTween.Completed:Connect(function()
			shopFrame.Visible = false
			shopBtn.TextLabel.Text = "Buy Cash!"
		end)
	end
end)

shopBtn.MouseButton1Click:Connect(function()
	-- used to toggle the isOpen value to fire the Changed event.
	if isOpen.Value == true then
		isOpen.Value = false
	elseif isOpen.Value == false then
		isOpen.Value = true
	end
end)
