O'k so i have a "Folder" called Library in my game, that is in my ServerStorage, anyway i have multiple Folders Inside of Library, which all have specifically named items. So i have a script that will use the FindFirstChild() function to look for a child in the script. But if i keep adding more and more folders within folders of stuff, how can i make a script Find the Child in those deeper folders?
COMMUNITY QUESTION
How can i make script do a deep search?
1 answer
Not many people know that the FindFirstChild() function actually has two parameters: the name of the object you're looking for and whether or not the search is recursive. Since the recursive parameter defaults to false, you want to set it to true:
MyHouse:FindFirstChild("Bike",true) --My bike is in the garage, not just the house, so I need to use recursion to find it.
I hope this helped!
This discussion is preserved as it was. New answers, comments, and votes are closed.
