Garry's Mod Wiki

table.SortDesc

  table.SortDesc( table tbl )

Description

Sorts a table in reverse order from table.sort.

This function modifies the table you give to it. Like table.sort, it does not return anything.

Arguments

1 table tbl
The table to sort in descending order.

Example

local tbl = { 20, 10, 50, 30, 40, } table.SortDesc(tbl) PrintTable(tbl)
Output:
1 = 50 2 = 40 3 = 30 4 = 20 5 = 10