# Routes

````markdown
---
description: How to configure and add routes
---

# 🗺️ Routes

Routes are defined in `config/routes.lua`.

---

## Route Structure

```lua
Config.Routes = {
    ['route_id'] = {
        id = 'route_id',                    -- Unique route ID
        label = 'Route Name',               -- Display name
        description = 'Route description',  -- Description text
        requiredLevel = 1,                  -- Minimum level to access
        basePayment = 500,                  -- Base payment ($)
        bonusPerKm = 10,                    -- Bonus per kilometer
        xpReward = 10,                      -- XP reward
        timeLimit = 300,                    -- Time limit (seconds, 0 = no limit)
        vehicleType = 'small',             -- 'small' or 'big'
        locations = { ... }                 -- Pickup/Delivery locations
    }
}
````

### Vehicle Types

| Type    | System                                 | Vehicles                |
| ------- | -------------------------------------- | ----------------------- |
| `small` | Box loading (carry boxes to trunk)     | Mule, Mule3, Mule4      |
| `big`   | Trailer system (attach/detach trailer) | Hauler, Phantom, Packer |

### Location Structure

Each route can have **multiple locations**. A random one is selected each time.

```
locations = {
    {
        pickup = {
            coords = vector3(x, y, z),
            label = 'Warehouse A'
        },
        delivery = {
            coords = vector3(x, y, z),
            label = 'Port Warehouse'
        },
        cargo = 'Electronics',        -- Cargo name (display only)
        cargoWeight = 500             -- Cargo weight (display only)
    },
    -- Add more locations for variety
}
```

### Default Routes

#### 🟢 Short Route

* **Level:** 1
* **Payment:** $500
* **XP:** 10
* **Time:** 5 minutes
* **Type:** Small (Box loading)
* **Locations:** 3

#### 🟡 Medium Route

* **Level:** 5
* **Payment:** $1,200
* **XP:** 25
* **Time:** 8 minutes
* **Type:** Big (Trailer)
* **Locations:** 2

#### 🔴 Long Route

* **Level:** 10
* **Payment:** $2,500
* **XP:** 50
* **Time:** 15 minutes
* **Type:** Big (Trailer)
* **Locations:** 1

#### ⭐ VIP Route

* **Level:** 10
* **Payment:** $5,000
* **XP:** 100
* **Time:** No limit
* **Type:** Big (Trailer)
* **Locations:** 1

\
Adding a New Route

```
['custom'] = {
    id = 'custom',
    label = 'Custom Route',
    description = 'My custom delivery route',
    requiredLevel = 3,
    basePayment = 800,
    bonusPerKm = 15,
    xpReward = 20,
    timeLimit = 400,
    vehicleType = 'small',
    locations = {
        {
            pickup = {
                coords = vector3(100.0, 200.0, 30.0),
                label = 'My Warehouse'
            },
            delivery = {
                coords = vector3(500.0, 600.0, 30.0),
                label = 'Delivery Point'
            },
            cargo = 'Custom Cargo',
            cargoWeight = 600
        }
    }
}
```

💡 **Tip:** Don't forget to add box count for your new route in `Config.DeliverySystem.boxCount`:

```
boxCount = {
    ['custom'] = 4,  -- Add this
}
```


---

# 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://elena-scripts.gitbook.io/elenascripts/jobs-and-activities/truck-job-v2/routes.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.
