local L=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local c=TweenInfo.new(.7,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0)local X=script.Parent.Open local n=script.Parent.Close local G=script.Parent.ClickDetector local R=script.Parent.Parent.Center local e=script.Parent.Parent.Parent.Door2Origin local m=script.Parent.Parent.Parent.Door2ToGo local l=false local b=false G.MouseClick:Connect(function()if l==false and b==false then b=true l=true;(L:Create(R,c,{CFrame=m.CFrame})):Play()X:Play()wait(.7)b=false elseif l==true and b==false then b=true l=false;(L:Create(R,c,{CFrame=e.CFrame})):Play()wait(.5)n:Play()wait(.2)b=false end end)


local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(0.7, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0)

local openSound = script.Parent.Open
local closeSound = script.Parent.Close

local click = script.Parent.ClickDetector

local center = script.Parent.Parent.Center
local origin = script.Parent.Parent.Parent.Door2Origin
local toGo = script.Parent.Parent.Parent.Door2ToGo

local isOpen = false
local isMoving = false

click.MouseClick:Connect(function()
	if isOpen == false and isMoving == false then
		isMoving = true
		isOpen = true
		
		TweenService:Create(center, Info, {CFrame = toGo.CFrame}):Play()
		openSound:Play()
		
		wait(0.7)
		isMoving = false
	elseif isOpen == true and isMoving == false then
		isMoving = true
		isOpen = false
		
		TweenService:Create(center, Info, {CFrame = origin.CFrame}):Play()
		
		wait(0.5)
		closeSound:Play()
		
		wait(0.2)
		isMoving = false
	end
end)
