Hi! I was wondering if there was a way to use a for loop to loop through a character’s parts to only reference or get specific character body parts. For example I want to loop through a character’s baseparts and only find the UpperTorso and the Head (R15 Body Type).
I tried writing the code like this, but it doesn’t work:
for _, v in pairs(Character:GetChildren()) do
if v == "UpperTorso" or "Head" then
print(v)
end
end
It doesn’t print only the UpperTorso or the Head, but instead prints all of the the character’s descendants including local scripts. Can someone help me find a solution to this? Thanks!