How to do a for loop past a specific frame

so im making admin commands and

i have this

how would i make it so the top fly me frame, if a player clicks it, it needs to go from there to the bottom and move the frames into a different folder, then put those desk,aliases,level,undo, and syntax there, then re add those. if you dont know what I mean try hd admin’s command frame, where you click it and something comes up, how would I do that?
what I mean below:

https://gyazo.com/0dab19dedfafc0d69ef63ff471e399c0

image

You would want to organize your commands like this. UIListLayout automatically puts each element in a list so they do not overlap. (You might already be using this.) Every GUI object has a LayoutOrder property. You want to increment each command’s LayoutOrder.

do
	local LastLayoutOrder = 0
	
	for _,child in pairs(Commands:GetChildren()) do
   		child.LayoutOrder = LastLayoutOrder + 1
	end
end

When you want to add the command details. Create that object and set its LayoutOrder to the same as the command’s LayoutOrder.

I tried to explain this as best as I could, if you have questions just ask!

Oh, thank you! I’ll try it Hopefully it works