local l=script.Parent.PivotL local s=script.Parent.PivotR local b=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local p=Instance.new("\067\108\105\099\107\068\101\116\101\099\116\111\114",script.Parent.L)local W=Instance.new("\067\108\105\099\107\068\101\116\101\099\116\111\114",script.Parent.R)local R=false local A=false local function C()if not A then A=true if R==false then(b:Create(l,TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame=l.CFrame*CFrame.Angles(math.rad(160),0,0)})):Play()local p=b:Create(s,TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame=s.CFrame*CFrame.Angles(math.rad(-170),0,0)})p.Completed:Connect(function()R=not R A=false end)p:Play()else(b:Create(l,TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame=l.CFrame*CFrame.Angles(math.rad(-160),0,0)})):Play()local p=b:Create(s,TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame=s.CFrame*CFrame.Angles(math.rad(170),0,0)})p.Completed:Connect(function()R=not R A=false end)p:Play()end end end p.MouseClick:Connect(function()C()end)W.MouseClick:Connect(function()C()end)


local P1 = script.Parent.PivotL
local P2 = script.Parent.PivotR
local TS = game:GetService("TweenService")

local CD1 = Instance.new("ClickDetector",script.Parent.L)
local CD2 = Instance.new("ClickDetector",script.Parent.R)

local toggle = false
local deb = false
local function Box()
	if not deb then
		deb = true
		if toggle == false then
			TS:Create(P1,
				TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),
				{CFrame = P1.CFrame * CFrame.Angles(math.rad(160),0,0)}
			):Play()
			local t1 = TS:Create(P2,
				TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),
				{CFrame = P2.CFrame * CFrame.Angles(math.rad(-170),0,0)}
			)
			t1.Completed:Connect(function()
				toggle = not toggle
				deb = false
			end)
			t1:Play()
		else
			TS:Create(P1,
				TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),
				{CFrame = P1.CFrame * CFrame.Angles(math.rad(-160),0,0)}
			):Play()
			local t1 = TS:Create(P2,
				TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),
				{CFrame = P2.CFrame * CFrame.Angles(math.rad(170),0,0)}
			)
			t1.Completed:Connect(function()
				toggle = not toggle
				deb = false
			end)
			t1:Play()
		end
	end
end

CD1.MouseClick:Connect(function()
	Box()
end)

CD2.MouseClick:Connect(function()
	Box()
end)
