Search through all parts to find one part named GO

Hello, this is what I need help with,

Lets say you need to search through all the parts in a folder, So the script searches through it, and if it finds a part named GO, it prints a message like “Yes, Found one.”. but If it can’t find one it print’s something like “No, No GO parts.”

Thanks in advance!

You can use :FindFirstChild("GO", true) to search the entire hierarchy tree for a part named “GO”. If it doesn’t return nil then there is a part named “GO” in that folder.

1 Like

You can use an Instance’s Instance:FindFirstChild(String name, bool recursive) function to search recursively through every descendent (and every descendent’s descendents) in your folder for name.
If the function finds it, it will return that Instance. If it doesn’t find it (doesn’t exist in your folder) it will return nil (nothing).

1 Like

And add this too.

1 Like

Thanks y’all! Could someone give me an example? If so, thank you!

EDIT: Found it! Thanks y’all!