local l=script.Parent.Parent.Parent.Outputs.DoorOpen function MoveDoor(l)local c=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local g=TweenInfo.new(2.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)local A=c:Create(script.Parent.Door.Hinge.HingeConstraint,g,{TargetAngle=l})A:Play()end l.Changed:Connect(function(l)wait(.5)if script.Parent.Parent.Parent.Outputs.DoorOpen.Value==false then MoveDoor(0)return end if l then MoveDoor(90)else MoveDoor(0)end end)


local doorvalue = script.Parent.Parent.Parent.Outputs.DoorOpen

function MoveDoor(angle)
	local tweenservice = game:GetService("TweenService")
	local tweeninfo = TweenInfo.new(2.5 , Enum.EasingStyle.Sine , Enum.EasingDirection.InOut)
	local tween = tweenservice:Create(script.Parent.Door.Hinge.HingeConstraint , tweeninfo , {TargetAngle = angle})
	tween:Play()
end

doorvalue.Changed:Connect(function(newdoorvalue)
	wait(0.5)
	if script.Parent.Parent.Parent.Outputs.DoorOpen.Value == false then
		MoveDoor(0)
		return
	end
	if newdoorvalue then
		MoveDoor(90)
	else
		MoveDoor(0)
	end
end)
