I have the script that makes players not collide with npcs but I don't know where to put it nor how to make group collisons. Can anyone tell me where to put the script and how to make collison group for npcs?
local PhysicsService =
game:GetService("PhysicsService")
npcGroup = "npcGroup"
PhysicsService:CreateCollisionGroup(npcGroup) PhysicsService:CollisionGroupSetCollidable(npcGroup, npcGroup, false)
local function setCollisionGroupRecursive(object)
if object:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(object, npcGroup)
end
for _, child in ipairs(object:GetChildren()) do
setCollisionGroupRecursive(child)
end
end
npc = workspace.NPC
setCollisionGroupRecursive(npc)

6 comments
So you made this or did you not. If you didn't make this, you need to not rush yourself in learning. Your learning pace is obviously slower than this.
I made this out of what others told me on a vid on YT and so far nothing is helping me about this problem
This proves that YouTube videos don't work. They don't help you learn. There are no good YouTube channels yet. The only thing YouTube videos do is spoon feed. They just tell you to copy what is written without actually explaining. You should take a step back, and come back to this when you're more confident
How does that help me? That makes me a little offenced
Aka discouraged
This code should work fine, but it's setting up for things in the npcGroup to not collide with each other. So NPCs will be able to pass right through other NPCs. You could make a playerGroup, set that to not collide with the npcGroup, and then set all parts of a player model to the playerGroup the same way you're doing here for the NPCs.