local J=script.Parent.Pivot1 local H=script.Parent.Pivot2 local u=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local G=false local y=false local V=Instance.new("\067\108\105\099\107\068\101\116\101\099\116\111\114",script.Parent.Handle1)V.MaxActivationDistance=5 local f=Instance.new("\067\108\105\099\107\068\101\116\101\099\116\111\114",script.Parent.Handle2)f.MaxActivationDistance=5 local S=Instance.new("\067\108\105\099\107\068\101\116\101\099\116\111\114",script.Parent.Door1)S.MaxActivationDistance=5 local R=Instance.new("\067\108\105\099\107\068\101\116\101\099\116\111\114",script.Parent.Door2)R.MaxActivationDistance=5 local K=J.CFrame local M=H.CFrame local function F()if not G then G=true local V local f if not y then V=u:Create(J,TweenInfo.new(1.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame=K*CFrame.Angles(-math.rad(150),0,0)})f=u:Create(H,TweenInfo.new(1.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame=M*CFrame.Angles(math.rad(150),0,0)})else V=u:Create(J,TweenInfo.new(1.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame=K})f=u:Create(H,TweenInfo.new(1.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame=M})end V.Completed:Connect(function()y=not y G=false end)V:Play()f:Play()end end V.MouseClick:Connect(function()F()end)f.MouseClick:Connect(function()F()end)S.MouseClick:Connect(function()F()end)R.MouseClick:Connect(function()F()end)


local p1 = script.Parent.Pivot1
local p2 = script.Parent.Pivot2
local TS = game:GetService("TweenService")
local deb = false
local toggled = false

local cd1= Instance.new("ClickDetector",script.Parent.Handle1)
cd1.MaxActivationDistance = 5
local cd1_2 = Instance.new("ClickDetector",script.Parent.Handle2)
cd1_2.MaxActivationDistance = 5
local cd2 = Instance.new("ClickDetector",script.Parent.Door1)
cd2.MaxActivationDistance = 5
local cd2_2 = Instance.new("ClickDetector",script.Parent.Door2)
cd2_2.MaxActivationDistance = 5
local cf1 = p1.CFrame
local cf2 = p2.CFrame

local function locker()
	if not deb then
		deb = true
		local anim1
		local anim2
		if not toggled then
			anim1 = TS:Create(p1,
				TweenInfo.new(1.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),
				{CFrame = cf1 * CFrame.Angles(-math.rad(150),0,0)}
			)
			anim2 = TS:Create(p2,
				TweenInfo.new(1.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),
				{CFrame = cf2 * CFrame.Angles(math.rad(150),0,0)}
			)
		else
			anim1 = TS:Create(p1,
				TweenInfo.new(1.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),
				{CFrame = cf1}
			)
			anim2 = TS:Create(p2,
				TweenInfo.new(1.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),
				{CFrame = cf2}
			)
		end
		anim1.Completed:Connect(function()
			toggled = not toggled
			deb = false
		end)
		anim1:Play()
		anim2:Play()
	end
end

cd1.MouseClick:Connect(function()
	locker()
end)
cd1_2.MouseClick:Connect(function()
	locker()
end)
cd2.MouseClick:Connect(function()
	locker()
end)
cd2_2.MouseClick:Connect(function()
	locker()
end)
