> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-duel-arena-system/profiles-and-achievements.md).

# Profiles, Leaderboard and Achievements

Duelist profiles, statistics, titles, leaderboard, match history, server records and the 12 achievements of the RedM Duel & Arena System.

## The profile

Every character gets a duelist profile the first time they use the duel system. The **Profile** tab shows:

| Statistic                | Meaning                                       |
| ------------------------ | --------------------------------------------- |
| Rating and tier          | Current ELO rating and its tier badge         |
| Peak rating              | Highest rating reached                        |
| Season rank              | Position on the leaderboard                   |
| Wins, losses, win rate   | Duels against other players                   |
| Current and best streak  | Wins in a row                                 |
| Fastest and average draw | From the signal to the draw, in seconds       |
| Accuracy                 | Hits divided by shots fired                   |
| Headshot rate            | Headshots divided by hits                     |
| False starts             | Draws before the signal                       |
| Duel earnings            | Wager results, bounties and tournament prizes |
| Favourite weapon         | The weapon used in the most duels             |
| Record by mode           | Wins and losses for each duel mode            |
| Recent form              | The last 10 results                           |

The menu header also shows the player's cash and gold.

## Titles

Every profile carries a title under the name. The first entry the player qualifies for is used.

```lua
Config.Titles = {
    { id = 'fastest_hand',  stat = 'fastest',    max = 290 },
    { id = 'unbroken',      stat = 'bestStreak', min = 10 },
    { id = 'dead_centre',   stat = 'heads',      min = 50 },
    { id = 'deadshot',      stat = 'rating',     min = 1600 },
    { id = 'seasoned',      stat = 'wins',       min = 25 },
    { id = 'up_and_coming', stat = 'duels',      min = 1 },
    { id = 'greenhorn',     stat = 'duels',      min = 0 },
}
```

The text of each title is `title_<id>` in the [language file](/script-documentation/cas-duel-arena-system/languages.md), for example `title_unbroken = 'The Unbroken',`. Add `text = '...'` to an entry to use a fixed text instead.

Use `min` for "at least" and `max` for "at most". `fastest` is the fastest draw in milliseconds, so it uses `max`. The stats you can use are listed [below](#stats-you-can-use).

## Leaderboard and season

```lua
Config.Leaderboard = { size = 20, minDuels = 1 }
Config.Season = { ends = '2026-12-31' }
```

* The leaderboard ranks players by rating, then by wins. The top `size` players are listed, and every player always sees their own row.
* A player needs `minDuels` wins plus losses against other players to appear.
* The season name and a countdown to `ends` are shown on the leaderboard. The name is `season_name` in the [language file](/script-documentation/cas-duel-arena-system/languages.md); add `name = '...'` to `Config.Season` to use a fixed name.

{% hint style="info" %}
The season is a label and a countdown. Ratings are not reset automatically when it ends. Change the name and end date yourself when you start a new season.
{% endhint %}

## Match history

The **Match History** tab lists the player's latest 30 duels: opponent, mode, weapon, arena, score, wager, rating change, and every round with both players' draw times.

```lua
Config.History = { keep = 30 }
```

## Records

The **Achievements** tab also shows records.

**Personal records:** fastest draw, longest win streak, peak rating, biggest wager won, most headshots in a match, total winnings.

**Server records:** fastest draw on record, longest win streak, highest rating, largest pot, most tournament wins, each with the name of the player who holds it.

Dates on achievements and records use the year from `Config.WorldYear` (1899 by default). Set it to `false` to use the real year.

## Achievements

| Achievement              | Goal                                      |
| ------------------------ | ----------------------------------------- |
| First Blood              | Win your first duel.                      |
| Fastest Hand in the West | Draw in under 0.300 seconds.              |
| Dead Centre              | Land 100 headshots in duels.              |
| Unbroken                 | Win 10 duels in a row.                    |
| High Roller              | Win a single wager of $500 or more.       |
| Tournament Champion      | Win a duel tournament.                    |
| Clean Sweep              | Win a Best of 5 without dropping a round. |
| Iron Nerve               | Play 50 duels without a false start.      |
| Man of the People        | Duel in front of 25 spectators.           |
| Legend Slayer            | Beat a Legend-difficulty outlaw.          |
| Veteran                  | Fight 250 duels.                          |
| Pistolero                | Reach a rating of 1400.                   |

A message appears the moment an achievement unlocks, and the date is saved.

### Adding or changing achievements

```lua
{ id = 'a4', icon = 'star', stat = 'bestStreak', goal = 10 },
```

| Field          | Meaning                                                                                                                                                                                 |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`           | Unique id. Changing it resets that achievement for everyone.                                                                                                                            |
| `name`, `desc` | Optional. Fixed text for every language. Without them the text is `ach_<id>_name` and `ach_<id>_desc` in the [language file](/script-documentation/cas-duel-arena-system/languages.md). |
| `icon`         | Icon name, see the list below.                                                                                                                                                          |
| `stat`         | The statistic to track.                                                                                                                                                                 |
| `goal`         | The value that unlocks it.                                                                                                                                                              |
| `money`        | Optional. `true` shows the progress as dollars.                                                                                                                                         |

**Icons:** `shootout`, `trophy`, `gunslinger`, `clock`, `handgun`, `target`, `skull`, `health`, `stamina`, `melee`, `bullets`, `leader`, `shield`, `medalAward`, `rank`, `spectate`, `holster`, `star`, `ratingStar`, `diamond`, `gold`, `medalGold`, `medalSilver`, `medalBronze`, `coins`, `cash`, `bills`, `poster`.

### Stats you can use

| Stat                   | Counts                                                 |
| ---------------------- | ------------------------------------------------------ |
| `wins`, `losses`       | Duels won and lost against players                     |
| `duels`                | All duels fought, including NPC duels                  |
| `rating`, `peak`       | Current and highest rating                             |
| `streak`, `bestStreak` | Current and longest win streak                         |
| `heads`                | Headshots landed                                       |
| `hits`, `fired`        | Hits landed and shots fired                            |
| `falseStarts`          | False starts                                           |
| `clean`                | Duels in a row without a false start                   |
| `sub300`               | Draws faster than 0.300 seconds                        |
| `bestWager`            | Biggest wager won                                      |
| `earnings`             | Total duel earnings                                    |
| `maxCrowd`             | Most spectators watching one of your duels             |
| `sweepBo5`             | Best of 5 matches won without dropping a round         |
| `legend`               | Legend outlaws beaten                                  |
| `tWins`                | Tournaments won                                        |
| `fastest`              | Fastest draw in milliseconds (titles only, with `max`) |

## Profile pictures

With `steam_webApiKey` set in `server.cfg`, portraits use the player's Steam profile picture. Without it, the game's default silhouette is used. NPC outlaws always use their own portrait. See [Installation](/script-documentation/cas-duel-arena-system/installation.md).
