local PhysicsService = game:GetService('PhysicsService')
local Players = game:GetService('Players')
PhysicsService:CreateCollisionGroup('Players')
PhysicsService:CreateCollisionGroup('NPCs')
PhysicsService:CollisionGroupSetCollidable('Players', 'NPCs', false)
local NPC = game.ReplicatedStorage.EventEnemies.Mini
local function SetModelGroup(Model, Group)
for _, Part in ipairs(Model:GetChildren())
do
if (Part:IsA 'BasePart') then
PhysicsService:SetPartCollisionGroup(Part, Group)
end
end
end
local function OnClientAdded(Client)
local function OnCharacterLoaded(Character)
SetModelGroup(Character, 'Players')
end
Client.CharacterAppearanceLoaded:Connect(OnCharacterLoaded)
end
SetModelGroup(NPC, 'NPCs')
Players.PlayerAdded:Connect(OnClientAdded)
This script makes a NPC non collide able, but theres more than one model, I tried to create multiple scripts for each mode, but it didn't work. I tried multiple ways to make more than one NPC model work inside of a script but none of them worked. Is there a way to make multiple models work with this script? hopefully that made sense
