1 | for _, gui in pairs (script.Parent.Abilities:GetChildren() and script.Parent.Passives:GetChildren()) do |
2 |
3 | end ) |
As shown in the code above, when I use "and" it only loops through the 2nd argument, vice versa if I use "or" it only loops through the 1st argument. I was wondering if there is a way to achieve looping through both parameters without making 2 separate loops thanks.
You could always get descendants but that will return all the children. You could filter it by adding an if statement, its better if I show you the code.
1 | for _, gui in pairs (script.Parent.Abilities:GetDescendants()) do |
2 | if gui.Parent.Name = = "so and so... the folder or frame u want to get" then |
3 | -- ... code ... |
4 | end |
5 | end ) |
If this helped, i'd appreciate this being accepted, have a question, add a comment. Good luck.