local N=(Instance.new("\080\097\114\116")).GetConnectedParts local p=script.GetChildren function GetPartJoints(p,f)local z={}for N,p in pairs(SearchJoints(p,p,f))do z[N]=p end for N,D in pairs(N(p))do for N,p in pairs(SearchJoints(D,p,f))do z[N]=p end end return z end
-- References to reduce indexing time
local GetConnectedParts = Instance.new("Part").GetConnectedParts
local GetChildren = script.GetChildren

function GetPartJoints(Part, Whitelist)
	-- Returns any manual joints involving `Part`

	local Joints = {}

	-- Get joints stored inside `Part`
	for Joint, JointParent in pairs(SearchJoints(Part, Part, Whitelist)) do
		Joints[Joint] = JointParent
	end

	-- Get joints stored inside connected parts
	for _, ConnectedPart in pairs(GetConnectedParts(Part)) do
		for Joint, JointParent in pairs(SearchJoints(ConnectedPart, Part, Whitelist)) do
			Joints[Joint] = JointParent
		end
	end

	-- Return all found joints
	return Joints
end
