local q=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local n=script.Parent local g=script.Parent.Parent.MainDoor.ClickDetector local M={CFrame=n.CFrame*CFrame.Angles(0,math.rad(-78),0)}local N={CFrame=n.CFrame*CFrame.Angles(0,0,0)}local d=TweenInfo.new(1)local x=q:Create(n,d,M)local v=q:Create(n,d,N)local P=false g.MouseClick:Connect(function()if P==false then x:Play()P=true else v:Play()P=false end end)


local TweenService = game:GetService("TweenService")
local Hinge = script.Parent
local clickDetector = script.Parent.Parent.MainDoor.ClickDetector

local Goal = {
	CFrame = Hinge.CFrame * CFrame.Angles(0,math.rad(-78),0)
}

local Goal2 = {
	CFrame = Hinge.CFrame * CFrame.Angles(0,0,0)
}

local tweenInfo = TweenInfo.new(1)

local doorOpen = TweenService:Create(Hinge, tweenInfo, Goal)
local doorClose = TweenService:Create(Hinge, tweenInfo, Goal2)

local isOpen = false

clickDetector.MouseClick:Connect(function()
	if isOpen == false then
		doorOpen:Play()
		isOpen = true
	else
		doorClose:Play()
		isOpen = false
	end
end)
