local v=script.Parent.Hinge.Position local N=script.Parent.Handle local u=false local j="\079\110"local a=script.Parent.Handle.CFrame local l=script.Parent.HandleOff.CFrame local J=script.Parent.HandleOn.CFrame local q=false local h=false function down()q=true for v=.1,1,.01 do script.Parent.Handle.CFrame=a:Lerp(l,v)wait()end q=false end function up()h=true for v=.1,1,.01 do script.Parent.Handle.CFrame=script.Parent.Handle.CFrame:Lerp(J,v)wait()end h=false end N.ClickDetector.MouseClick:Connect(function()if u==false then u=true if q==true then else down()end local v=script.Parent.Parent:FindFirstChild(j)assert(v,"\069\114\114\111\114 \070\105\110\100\105\110\103 \078\097\109\101\033")v.Value=false v.Name="\040\068\105\115\097\098\108\101\100\041"j="\040\068\105\115\097\098\108\101\100\041"else u=false if h==true then else up()end local v=script.Parent.Parent:FindFirstChild(j)assert(v,"\069\114\114\111\114 \070\105\110\100\105\110\103 \078\097\109\101\033")v.Name="\079\110"j="\079\110"end end)
--- AS OF NOW THIS ONLY WORKS ON THUNDERBOLTS

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)
