I'm trying to make the grid stay the same size if it goes to a new row. The code I've made makes the grid elements go back and forth.
window.TaskBar.OpenPrograms.UIGridLayout.CellSize = UDim2.new(window.TaskBar.OpenPrograms.UIGridLayout.AbsoluteCellCount.Y > 1 and 1/openprograms or 0, window.TaskBar.OpenPrograms.UIGridLayout.AbsoluteCellCount.Y > 1 and ((openprograms*-1)+1) or 160, 0, 22)
This is the code. Its supposed to change the cellsize from the constant size I set if the cell count y property is bigger than 1. It does this, but it will also cause the elements that would go on a new row to go back and forth.