> For the complete documentation index, see [llms.txt](https://fb-scripts.gitbook.io/fb-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fb-scripts.gitbook.io/fb-scripts/scripts/fb-blackmarket/adding-task.md).

# Adding Task

#### Task Types

| Type       | Tracking                              | Example                       |
| ---------- | ------------------------------------- | ----------------------------- |
| `action`   | Automatic — listens for game events   | Rob a house, steal a car      |
| `delivery` | Manual — player turns in items via UI | Sell drugs (deliver 3x tosti) |

#### Adding Tasks

```lua
Config.Tasks = {
    {
        id = "rob_house",
        name = "Rob a House",
        description = "Scout the target and execute the burglary...",
        icon = "fa-house-chimney-crack",
        type = "action",
        difficulty = "hard",         -- easy / normal / hard
        maxProgress = 2,             -- Complete 2 times
        xpReward = 100,              -- XP on completion
        renewalTime = 86400,         -- Reset after 24 hours (seconds)
        showRenewalTime = true,      -- Show countdown in UI
        shops = { "vip_smuggler" }   -- Optional: restrict to shops
    },
    {
        id = "sell_drugs",
        name = "Sell Drugs",
        type = "delivery",
        difficulty = "easy",
        maxProgress = 4,
        xpReward = 1500,
        renewalTime = 200,
        requiredItems = {
            { item = "tosti", amount = 3 }  -- Player must have 3x "tosti"
        }
    }
}
```

#### Event Mappings (for Action Tasks)

Connect external script events to task progress:

```lua
Config.EventMappings = {
    {
        type = "server",
        eventName = "qb-house-robbery:server:searchCabin",
        taskId = "rob_house",
        amount = 1
    },
    {
        type = "server",
        eventName = "qb-vehiclekeys:server:AcquireVehicleKeys",
        taskId = "steal_car",
        amount = 1
    }
}
```
