local function D(D)if not D:IsA("\066\097\115\101\080\097\114\116")then return end physicsService:SetPartCollisionGroup(D,"\067\104\097\114\097\099\116\101\114\115")end local function J(D)if not D:IsA("\066\097\115\101\080\097\114\116")then return end physicsService:SetPartCollisionGroup(D,"\068\101\102\097\117\108\116")end local function I(I)for J,I in ipairs(I:GetDescendants())do D(I)end I.DescendantAdded:Connect(D)I.DescendantRemoving:Connect(J)end local function f(J)for J,I in ipairs(J:GetDescendants())do D(I)end end

local function disableCollisions(descendant)
	if not descendant:IsA("BasePart") then return end
	physicsService:SetPartCollisionGroup(descendant, "Characters")
end

local function enableCollisions(descendant)
	if not descendant:IsA("BasePart") then return end
	physicsService:SetPartCollisionGroup(descendant, "Default")
end

local function handleCharacter(character)
	for _, descendant in ipairs(character:GetDescendants()) do
		disableCollisions(descendant)
	end
	character.DescendantAdded:Connect(disableCollisions)
	character.DescendantRemoving:Connect(enableCollisions)
end

local function handleNPcs(v)
	for _, descendant in ipairs(v:GetDescendants()) do
		disableCollisions(descendant)
	end
end

