Hi there, I apologize if my post does not follow community expectations, this is my first time posting on a forum. I am currently trying to clone a player’s character within a script but I want to remove everything that is not a player’s torso, head, arms, legs, etc. I.e. I want to remove humanoid, health data, player stats, and so forth. Without manually deleting everything in the cloned module. Does anyone have a simple way to perform this? Or a reference point you think may be helpful?
If you are literally only wanting the body parts and no accessories, then I would suggest using this loop:
for _, child in pairs(clone:GetChildren()) do
if child.ClassName ~= "MeshPart" then
child:Destroy()
end
end
If you are wanting the accessories to be kept, then I would suggest adding and child.ClassName ~= "Accessory"
, after "MeshPart"
1 Like
for _, Parts in ipairs(person:GetChildren()) do
if not Parts:IsA("BasePart") then
Parts:Destroy()
end
end
2 Likes