--Ahoj, vím že ze koukaš na tenhle script, tohle je muj první door script. neočekavej že to bude fungovat


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)
