Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to loop through all parts of R15 Rig?

I have been using R6 for some time and now want to make things work with R15. I have a char script that chars the parts of a R6 rig but I wrote out all of the parts of the rig. In R15 there are quite a few parts to call on. Is there a way to have the script find the rig get all of its parts and char them without me having to define each part of the R15 Rig?

Thank you for the help.

1 comment

0

You could use a for loop, and check out name if they have "Torso", 'Leg', or 'Arm' in the name via a function like string.match.

1 answer

✓ Accepted answer

You can get all the parts of an R15 character by using some conditional statements and a for loop. Here's an example :

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		for i,v in pairs(char:GetChildren()) do --Gets children of character
			if v:IsA('Part') or v:IsA('MeshPart') then --Checks if object is a part or meshpart
				print(v) --Prints name of part
			end
		end
	end)
end)

Basically when a player spawns, the script checks if any of the objects in the character are parts or meshparts, then it prints the parts or meshparts.

Also I don't get what you mean by "char them". Do you mean char them like packages?

Hope this helped anyways!

1 comment

0

Yes char like a package or change the colors of the rig,  Thank you for your help this answers my question :) .

This discussion is preserved as it was. New answers, comments, and votes are closed.