Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Multiple parameters in for pair loops?

for _, gui in pairs(script.Parent.Abilities:GetChildren() and script.Parent.Passives:GetChildren())do

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.

2 comments

0

You could make a new table with all of the values inside of it. I don't really see a different way of doing it. I recommend merging the tables with a for loop.

0

REAL TIN CAN !! ! ! !!! ! :D WHERE HAVE U beEEEEEEEEEEEEEeeeennnnnnnnnnn

1 answer

✓ Accepted answer

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.

for _, gui in pairs(script.Parent.Abilities:GetDescendants()) do
	if gui.Parent.Name == "so and so... the folder or frame u want to get" then
		-- ... code ...
	end
end)

If this helped, i'd appreciate this being accepted, have a question, add a comment. Good luck.

2 comments

0

omg my man I will be BACK AND SEE YOU ONE DAY TYYYY!!!!!

0

anytime BRUDDuH

This discussion is preserved as it was. New answers, comments, and votes are closed.