local I=require(script.Parent:WaitForChild("\103\101\116\076\097\115\116\087\111\114\100\070\114\111\109\080\097\115\099\097\108\067\097\115\101"))local J={Hand="\065\114\109",Foot="\076\101\103"}function getLimbType(z)local G=I(z)return J[G]and G end function getLimbs(I,J)local z={}local G={}local R={}local function L(I,g)if I.Name~="\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116"then local J=getLimbType(I.Name)z[J]=z[J]or{}table.insert(z[J],I)local L=z[J]if J~=g then G[J]=G[J]or{}if g then G[J][g]=true end table.insert(R,{Part=I;Type=J})g=J end end local a,l,V=pairs(I:GetChildren())while true do local z,G=a(l,V)if z then else break end V=z if G:isA("\065\116\116\097\099\104\109\101\110\116")then if J[G.Name]then local z=J[G.Name].Attachment1.Parent if z then if z~=I then L(z,g)end end end end end end L(I)return z,R,G end function createNoCollision(I,J)local z=Instance.new("\078\111\067\111\108\108\105\115\105\111\110\067\111\110\115\116\114\097\105\110\116")z.Name=I.Name..("\060-\062"..J.Name)z.Part0=I z.Part1=J return z end return function(I,J)local z=Instance.new("\070\111\108\100\101\114")z.Name="\078\111\067\111\108\108\105\115\105\111\110\067\111\110\115\116\114\097\105\110\116\115"local G,R,L=getLimbs(J,I)for I=1,#R,1 do for J=I+1,#R,1 do local G=R[I].Type local g=R[J].Type if not L[G][g]and not L[g][G]then(createNoCollision(R[I].Part,R[J].Part)).Parent=z end end end for I,J in pairs(G)do for I,R in pairs(L[I])do for I,G in pairs(G[I])do for I,J in pairs(J)do(createNoCollision(J,G)).Parent=z end end end end return z end


local u1 = require(script.Parent:WaitForChild("getLastWordFromPascalCase"));
local u2 = {
	Hand = "Arm", 
	Foot = "Leg"
};
function getLimbType(p1)
	local v1 = u1(p1);
	return u2[v1] and v1;
end;
function getLimbs(p2, p3)
	local u3 = {};
	local u4 = {};
	local u5 = {};
	local function u6(p4, p5)
		if p4.Name ~= "HumanoidRootPart" then
			local v2 = getLimbType(p4.Name);
			u3[v2] = u3[v2] or {};
			table.insert(u3[v2], p4);
			local v3 = u3[v2];
			if v2 ~= p5 then
				u4[v2] = u4[v2] or {};
				if p5 then
					u4[v2][p5] = true;
				end;
				table.insert(u5, {
					Part = p4, 
					Type = v2
				});
				p5 = v2;
			end;
		end;
		local v4, v5, v6 = pairs(p4:GetChildren());
		while true do
			local v7, v8 = v4(v5, v6);
			if v7 then

			else
				break;
			end;
			v6 = v7;
			if v8:isA("Attachment") then
				if p3[v8.Name] then
					local l__Parent__9 = p3[v8.Name].Attachment1.Parent;
					if l__Parent__9 then
						if l__Parent__9 ~= p4 then
							u6(l__Parent__9, p5);
						end;
					end;
				end;
			end;		
		end;
	end;
	u6(p2);
	return u3, u5, u4;
end;
function createNoCollision(p6, p7)
	local v10 = Instance.new("NoCollisionConstraint");
	v10.Name = p6.Name .. "<->" .. p7.Name;
	v10.Part0 = p6;
	v10.Part1 = p7;
	return v10;
end;
return function(p8, p9)
	local v11 = Instance.new("Folder");
	v11.Name = "NoCollisionConstraints";
	local v12, v13, v14 = getLimbs(p9, p8);
	for v15 = 1, #v13 do
		for v16 = v15 + 1, #v13 do
			local l__Type__17 = v13[v15].Type;
			local l__Type__18 = v13[v16].Type;
			if not v14[l__Type__17][l__Type__18] and not v14[l__Type__18][l__Type__17] then
				createNoCollision(v13[v15].Part, v13[v16].Part).Parent = v11;
			end;
		end;
	end;
	for v19, v20 in pairs(v12) do
		for v21, v22 in pairs(v14[v19]) do
			for v23, v24 in pairs(v12[v21]) do
				for v25, v26 in pairs(v20) do
					createNoCollision(v26, v24).Parent = v11;
				end;
			end;
		end;
	end;
	return v11;
end;
