# Progression

> The progression system introduces a gamification mechanic designed to incentivize continuous participation and reward racer performance. As players compete, they accumulate experience (XP) to level up and access exclusive rewards.

<figure><img src="/files/O5MAQ3m8Y7aSFedauveW" alt=""><figcaption></figcaption></figure>

#### How it Works

* **Earning XP:** Players automatically earn experience points (XP) upon completing races. The system is designed to award higher XP based on the final finishing position, motivating players to not just participate, but to strive for victory.
* **Levels & Scaling:** Progression is linear and consistent. Every 100 XP accumulated equals a new level.
  * *Example:* 150 XP = Level 1 (with 50% progress toward Level 2).
* **Unlockable Rewards:** Each level can be assigned a specific reward configured by the server.&#x20;
* **Claim System:** The user must manually click "Redeem" to claim their prizes, which will then be visually marked as obtained.

#### Rewards

> Rewards config can be found in **`av_racing/server/editable/_progression.lua`**
>
> This file contains the `ProgressionLevels` table. Each reward entry must follow this structure:
>
> **reward:**
>
> * **identifier?:**`string` Unique identifier for the prize, default Level1, Level2, Level3...
> * **level:**`number` Level needed to redeem it (should be unique),
> * **label:**`string` Label shown in UI
> * **image?**:`string` Image URL to show as card background
> * **description?:**`string` Short description shown in UI when a level card is flipped (the info icon)
> * **notification?:**`string` Notification to show after redeem
> * **onRedeem:**`function()` **Server function to trigger on redemption**
>
> ```lua
> {
>     level = 1, -- required level, should be unique
>     label = "10 Cosmo", -- label for UI card
>     image = "tokens.png", -- image to use or null to use default
>     notification = "You received 10 Cosmo", -- notification to show after redeem
>     onRedeem = function(playerId, identifier)
>         -- your custom code to reward player goes here :)
>         -- EXAMPLE to reward 10 cosmo
>         exports['av_laptop']:addMoney(playerId, "cosmo", 10)
>     },
>     end,
> },
> ```

### XP Rewards

> The XP configuration is located in `av_racing/server/editable/_xp.lua`.\
> In this file, you can adjust the base XP reward for all players and define bonus XP for those finishing in top positions.
>
> ```lua
> local baseXP = 5 -- base XP a racer will receive after completing a race, this doesn't apply for positions table
> local xpPositions = { -- Will reward a random amount between min and max
>     [1] = {min = 20, max = 30},
>     [2] = {min = 15, max = 20},
>     [3] = {min = 10, max = 15},
>     [4] = {min = 5, max = 10},
> }
> ```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.av-scripts.com/laptop-pack-v3/racing/progression.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
