You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? I want all BaseParts (Parts and MeshParts) to have their collision group set to “GroupTeam”.
-
What is the issue? Only instances with the type of “Part” get their their collision group set to “GroupTeam”
-
*What solutions have you tried so far? *I tried fixing my if statement by trying to chane it to:
if descendant:IsA("Part") or descendant:IsA("Meshpart) then
-- Function
if descendant:IsA("Part") then
-- Function
if descendant:IsA("Meshpart) then
-- Function
local PhysicsService = game:GetService("PhysicsService")
local Players = game:GetService("Players")
local Teams = game:GetService("Teams")
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if player.Team == Teams["Choosing..."] or player.Team == Teams.Immigrants then
return
end
for _, descendant in character:GetDescendants() do
if descendant:IsA("BasePart") then
descendant.CollisionGroup = "GroupTeam"
end
end
end)
end)