I was wondering if it was possible to find a child of a table, kind of how you’re able to do it with objects in workspace. If so, how would I go about it? I would use for loops but it’s kind of messy, but if there isn’t any other way, I’ll resort to it.
No you would not, I’m not sure I understand what you’re trying to do but table.find just returns the numerical index or occurence of an element in a table, you cannot use it to index an element unless through otherwise unnecessarily extra code.
For instance:
local tab = {"a", "b"}
print(table.find(tab, "b")) --> would print 2
If you meant you wanted to get all children of an instance and create a table, use Instance:GetChildren()
Can you give an example or demonstration of what you’re trying to achieve??
I’m trying to use :GetCharacterAppearanceInfoAsync() which returns a ton of tables and subtables, and I’m trying to go through each one and trying to find the accessory ID, therefore I believe table.find with a for loop would be more efficient in this case.
table.find can’t be used to search for a value between tables within other tables, if you want to verify an element is within one table then you could do:
I’m just trying to find if the index is “id” or not.
I don’t think it would be that hard as table.assets.id.Value should work actually, and then just do a for loop which removes each ID one by one until all of them are gone.