I recently made the following script, which I want to make a custom SortOrder, which is sorted from old to newer. I still don’t know how to apply the custom of any Enum property, so I have no idea how to do it
local GridLayout = script.Parent:WaitForChild("UIGridLayout")
local function add()
for index, SortOrder in pairs(Enum.SortOrder:GetEnumItems()) do
local Buttons = Instance.new("TextButton")
Buttons.Name = SortOrder.Name
Buttons.Text = SortOrder.Name
Buttons.Parent = script.Parent
Buttons.MouseButton1Click:Connect(function()
GridLayout.SortOrder = Enum.SortOrder[SortOrder.Name]
end)
end
end
--start
add()