August Update
Posted 2 months ago
Similar to stats, leaderboards no longer need to be defined in the backend. They can now be built on demand, from any player stat.
var board = Sandbox.Services.Leaderboards.GetFromStat( "facepunch.ss1", "victory_elapsed_time" );


board.SetAggregationMin(); // select the lowest value from each player
board.SetSortAscending(); // order by the lowest value first
board.FilterByMonth(); // only show results from this month
board.CenterOnMe(); // offset so I'm in the middle of the results
board.MaxEntries = 100;

await board.Refresh();

foreach ( var entry in board.Entries )
{
Log.Info( $"{entry.Rank} - {entry.DisplayName} - {entry.Value} [{entry.Timestamp}]" );
}
You can read more about using the new leaderboards here.