so currently what im tryina to is im trying to make it so that i,v loops around ths one folder and then it looks for a string value called 'Armor' but since the string value is a child of v the item inside the folders I cant seem to make it work can anyone help me out?
COMMUNITY QUESTION
How do I make i,v loop to findfirstchild()?
2 answers
I will go ahead and assume you're looking for something like:
local folder --whatever folder or object you're trying to search. Set this yourself.
local objectName = "Armor" --The name you're looking for.
local object
for i,v in pairs(folder:GetDescendants()) do
if v.Name == objectName then
object = v
break
end
end
if u put a "true" behind the thing u wanna find it will recurse until u find it, or it had searched all of its descendants(i think) like:
folder:FindFirstChild("stringValue", true)
"stringValue" being a child of a child of "folder"
2 comments
0
oof
0
The first guys is better, thb.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Are you needing something like :GetDescendants()?
"i, v loop" is not the correct term. It is "generic for loop".
using i, v for the index and value is merely convention.
incapaxian is right.