Explorer looks a bit like this:
- ScreenGui - Frame1 - Frame2 - Button - Button - Frame3 - Button
I can use Frame2:GetChildren()
and Frame3:GetChildren()
combined to get the buttons.
I need to get the buttons using only one function. Is there a way?
[EDIT]
I've found a way, you simply use i, v in pairs
twice.
for index, value in pairs(Frame:GetChildren()) do for i, v in pairs(value:GetChildren()) do -- stuff end end
A better way than what you are already did is to simply make a recurse function.
function recurse(o) for i,v in pairs(o:GetChildren()) do pcall(function() --if statement here recurse(v) end) end end recurse(Frame)