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

Does it find a random child or keeps finding the same child all the time you run the script?

I have a model and there are 2 parts inside it with the same name. Assuming the 2 parts' names are "Part", will this find a random child or, will it find the same child every time I run the script.

Model:FindFirstChild("Part")

I will appreciate your help!

1 answer

✓ Accepted answer

Model:FindFirstChild("Part")

Let's assume that Model has this hierarchy:

Model:
	[1] Part
	[2] TrussPart
	[3] Part

In this case, Model:FindFirstChild("Part"), will always grab the first instance of part. The first instance of the string part is at index one of the model.

Therefore, the part at index one will be obtained.

1 comment

0

Ok thanks!

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