how to add a thing to every bodypart in character
i try this script
for i ,v in pairs(Character:GetChildren()) do
if v:IsA(“MeshPart”) then
and is not working
how to add a thing to every bodypart in character
i try this script
for i ,v in pairs(Character:GetChildren()) do
if v:IsA(“MeshPart”) then
and is not working
Use v:IsA(“BasePart”), as MeshParts, Parts, and other part types are counted.
for i ,v in pairs(Character:GetChildren()) do
if v:IsA(“BasePart”) then
-- Do stuff
end
end
so if i want to add a part in every bodypart
i just do
part.Parent = v?
If you already have existing parts, yes. But that code would move the same part between each body part until all of them have had the part. If you wanted to create a new part, I would recommend using
Instance.new("Part", v)
to put a new part inside the Body Part (v)
or do part:Clone().Parent = v
, if it is a custom/modified part
If any of these replies have answered your question please mark your question as solved.
attempt to index nil with ‘GetChildren’
i did
for i ,v in pairs(Character:GetChildren()) do
Did you called out the Character with the Player or with the CharacterAdded() function?