local function T(T,E,i)assert(T)assert(E)assert(i)assert(i.UpperAngle>=0)assert(i.TwistLowerAngle<=i.TwistUpperAngle)return{attachment0=T,attachment1=E,limits=i}end local function E(E)return function(i,C,W)local r=E:FindFirstChild(i[1])local w=E:FindFirstChild(C[1])if r and w then local E=r:FindFirstChild(i[2])local J=w:FindFirstChild(C[2])if E and(J and(E:IsA("\065\116\116\097\099\104\109\101\110\116")and J:IsA("\065\116\116\097\099\104\109\101\110\116")))then return T(E,J,W)end end end end function RigTypes.getNoCollisions(T,E)if E==Enum.HumanoidRigType.R6 then return RigTypes.getR6NoCollisions(T)elseif E==Enum.HumanoidRigType.R15 then return RigTypes.getR15NoCollisions(T)else return{}end end

local function createJointData(attach0, attach1, limits)
	assert(attach0)
	assert(attach1)
	assert(limits)
	assert(limits.UpperAngle >= 0)
	assert(limits.TwistLowerAngle <= limits.TwistUpperAngle)

	return {
		attachment0 = attach0,
		attachment1 = attach1,
		limits = limits
	}
end

local function find(model)
	return function(first, second, limits)
		local part0 = model:FindFirstChild(first[1])
		local part1 = model:FindFirstChild(second[1])
		if part0 and part1 then
			local attach0 = part0:FindFirstChild(first[2])
			local attach1 = part1:FindFirstChild(second[2])
			if attach0 and attach1 and attach0:IsA("Attachment") and attach1:IsA("Attachment") then
				return createJointData(attach0, attach1, limits)
			end
		end
	end
end

function RigTypes.getNoCollisions(model, rigType)
	if rigType == Enum.HumanoidRigType.R6 then
		return RigTypes.getR6NoCollisions(model)
	elseif rigType == Enum.HumanoidRigType.R15 then
		return RigTypes.getR15NoCollisions(model)
	else
		return {}
	end
end
