local function onCharacterAdded(character)
for i, v in pairs(character:GetChildren())
do v.CollisionGroupId = 3
end
end
COMMUNITY QUESTION
Why won't the CharacterAdded code work?
1 answer
You need to make sure that it checks if its a part or not. Also make sure that the character isnt nil.
local function onCharacterAdded(character)
if character then
for i, v in pairs(character:GetChildren()) do
if v:IsA('BasePart') then
v.CollisionGroupId = 3
end
end
end
end
2 comments
1
it's a character added event though...It fires after the character exists
0
I like to double check.. and what about it huh. Ye i snapped :P
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Do you connect that function to the actual event?
you have to do it in a local script
why
and where