Hello, for some reason my script for no collision from the player and npc is not working and i don’t know what to do and the script it’s in ServerScriptService and is not showing any type of errors in output, here my script
Ps:CreateCollisionGroup("NPC")
Ps:CreateCollisionGroup("Players")
Ps:CollisionGroupSetCollidable("NPC", "Players", false)
for i, v in pairs(game.Workspace.NPC:GetChildren()) do
if v:IsA("Part") or v:IsA("MeshPart") then
Ps:SetPartCollisionGroup(v, "NPC")
end
end
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:connect(function(character)
for i, v in pairs(character:GetChildren()) do
if v:IsA("Part") or v:IsA("MeshPart") then
Ps:SetPartCollisionGroup(v, "Players")
end
end
end)
end)