function open()local a=(doora.PrimaryPart.Position-script.Parent.Parent.Ahit.Position).magnitude for a=0,1,speed/a do local Z=doora.PrimaryPart.CFrame doora:SetPrimaryPartCFrame(Z:lerp(script.Parent.Parent.Ahit.CFrame,a))wait()local T=(doora.PrimaryPart.Position-script.Parent.Parent.Ahit.Position).magnitude if T<=.1 then break end end end function close()local a=(doora.PrimaryPart.Position-script.Parent.Parent.OrigAhit.Position).magnitude for a=0,1,speed/a do local Z=doora.PrimaryPart.CFrame doora:SetPrimaryPartCFrame(Z:lerp(script.Parent.Parent.OrigAhit.CFrame,a))wait()local T=(doora.PrimaryPart.Position-script.Parent.Parent.OrigAhit.Position).magnitude if T<=.1 then break end end doora:SetPrimaryPartCFrame(doora.PrimaryPart.CFrame:lerp(script.Parent.Parent.OrigAhit.CFrame))end

function open()
	local mag = (doora.PrimaryPart.Position-script.Parent.Parent.Ahit.Position).magnitude
	for j = 0,1,speed/mag do
		local scf = doora.PrimaryPart.CFrame
		doora:SetPrimaryPartCFrame(scf:lerp(script.Parent.Parent.Ahit.CFrame,j))
		wait()
local magg = (doora.PrimaryPart.Position-script.Parent.Parent.Ahit.Position).magnitude
if magg <= 0.1 then break end
	end
end
function close()
	local mag = (doora.PrimaryPart.Position-script.Parent.Parent.OrigAhit.Position).magnitude
	for j = 0,1,speed/mag do
		local scf = doora.PrimaryPart.CFrame
		doora:SetPrimaryPartCFrame(scf:lerp(script.Parent.Parent.OrigAhit.CFrame,j))
		wait()
		local magg = (doora.PrimaryPart.Position-script.Parent.Parent.OrigAhit.Position).magnitude
if magg <= 0.1 then break end
	end
	doora:SetPrimaryPartCFrame(doora.PrimaryPart.CFrame:lerp(script.Parent.Parent.OrigAhit.CFrame))
	end