local Y=script.Parent.Hinge.Position local Q=script.Parent.Handle local J=false local p="\079\110"local H=script.Parent.Handle.CFrame local V=script.Parent.HandleOff.CFrame local n=script.Parent.HandleOn.CFrame local w=false local W=false function down()w=true for Y=.1,1,.01 do script.Parent.Handle.CFrame=H:Lerp(V,Y)wait()end w=false end function up()W=true for Y=.1,1,.01 do script.Parent.Handle.CFrame=script.Parent.Handle.CFrame:Lerp(n,Y)wait()end W=false end Q.ClickDetector.MouseClick:Connect(function()if J==false then J=true if w==true then else down()end local Y=script.Parent.Parent:FindFirstChild(p)assert(Y,"\069\114\114\111\114 \070\105\110\100\105\110\103 \078\097\109\101\033")Y.Value=false Y.Name="\040\068\105\115\097\098\108\101\100\041"p="\040\068\105\115\097\098\108\101\100\041"else J=false if W==true then else up()end local Y=script.Parent.Parent:FindFirstChild(p)assert(Y,"\069\114\114\111\114 \070\105\110\100\105\110\103 \078\097\109\101\033")Y.Name="\079\110"p="\079\110"end end)



local hingePos = script.Parent.Hinge.Position
local handle = script.Parent.Handle
local off = false
local setname = "On"


local c1 = script.Parent.Handle.CFrame
local c2 = script.Parent.HandleOff.CFrame
local c3 = script.Parent.HandleOn.CFrame

local dd = false
local ud = false

function down()
	dd = true
	for i = 0.1,1, 0.01 do
		script.Parent.Handle.CFrame = c1:Lerp(c2,i)
		wait()
	end
	dd = false
end

function up()
	ud = true
	for i = 0.1,1, 0.01 do
		script.Parent.Handle.CFrame = script.Parent.Handle.CFrame:Lerp(c3,i)
		wait()
	end
	ud = false
end


handle.ClickDetector.MouseClick:Connect(function()
	if off == false then
		off = true
		if dd == true then
			
		else
			down()
		end
		local n = script.Parent.Parent:FindFirstChild(setname)
		assert(n,"Error Finding Name!")
		n.Value = false
		n.Name = "(Disabled)"
		setname = "(Disabled)"
	else
		off = false
		if ud == true then
			
		else
			up()
		end
		local n = script.Parent.Parent:FindFirstChild(setname)
		assert(n,"Error Finding Name!")
		n.Name = "On"
		setname = "On"
	end
end)
