How to find a part that contains a specific name?

Here is the script:

for i,v in pairs(char:GetChildren())do
			if v:IsA("Part")then --I wanted to let the script find "leg" in the player's character
				game:GetService("TweenService"):Create(v,TweenI...
2 Likes
for i,v in pairs(char:GetChildren())do
	if v:IsA("Part") and v.Name == "NameHeREXd" then --I wanted to let the script find "leg" in the player's character
		game:GetService("TweenService"):Create(v,TweenI...
    end
end

you can use a simlple and (statement?), check if it is a part and the name == β€œleg” change the code above

1 Like