Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make Custom SortOrders on a UILayout Correctly?

Asked by 6 years ago

I am having trouble with the "Custom" SortOrder on a UIGridLayout. This is the code in a localscript in the UIGridLayout:(yes it does actually run)

local grid = script.Parent

grid:SetCustomSortFunction(function(A, B) 
    return tonumber(A.Name:sub(5)) < tonumber(B.Name:sub(5)) 
end)
grid.SortOrder = "Custom"
grid:ApplyLayout()

Whenever I join on an online server, Roblox either crashes, or "shuts down." Can someone help?

Answer this question