Randomize Button spawn

Hey, I am trying to make a function that spawns “5 X type buttons” and “20 Z type buttons” in a random order (this is because they are part of UIGridLayout and I want to randomize their position). I’d like to know how to achieve this.

you make a for loop for each button child and apply a randomized value

UDim2.new(0, math.random(min, max), 0, math.random(min, max))

it may not be accurate (since i haven’t scripted guis in a while) but it’ll give an idea