local function Y(Y)if not Y:IsA("\066\097\115\101\080\097\114\116")then return end physicsService:SetPartCollisionGroup(Y,"\067\104\097\114\097\099\116\101\114\115")end local function F(Y)if not Y:IsA("\066\097\115\101\080\097\114\116")then return end physicsService:SetPartCollisionGroup(Y,"\068\101\102\097\117\108\116")end local function W(W)for F,W in ipairs(W:GetDescendants())do Y(W)end W.DescendantAdded:Connect(Y)W.DescendantRemoving:Connect(F)end local function m(F)for F,W in ipairs(F:GetDescendants())do Y(W)end end
-- functions:
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
