> For the complete documentation index, see [llms.txt](https://s1h.gitbook.io/info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://s1h.gitbook.io/info/resources/s1h_uipack/editable-files/exports/skillbar.md).

# Skillbar

***

### StartSkillbar

Opens the skillbar minigame. The thread **pauses** until the player completes or fails all rounds, then returns the result.

**You can use it to add a skill-check challenge to any action — lockpicking, hacking, crafting, fishing, surgery, and more.**

**Note:** `StartSkillbar` is a blocking call — the thread will not continue until the minigame ends. Always call it inside a `CreateThread`.

```lua
local success = exports["s1h_uipack"]:StartSkillbar(options)
```

**Parameters :**

| Name                | Type   | Description                                                                                                                          |
| ------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| options.rounds      | number | Number of successful key presses required. Default: `3`. Capped at `Config.DefaultSkillbarMaxRounds`                                 |
| options.speed       | number | Moving bar speed. Lower = slower and easier. Default: `0.18`                                                                         |
| options.targetWidth | number | Width of the green success zone (1–100). Larger = easier. Default: `60`                                                              |
| options.shrink      | number | How much the success zone shrinks after each round. Default: `10`                                                                    |
| options.keys        | table  | Keys shown as prompts. Accepts **letters** (`"A"`–`"Z"`) and **numbers** (`"1"`–`"9"`). Default: `{'W','A','S','D','Q','E','R','F'}` |

**Return value :** `boolean` — `true` if all rounds passed, `false` if the player failed.

***

**Example — basic :**

```lua
CreateThread(function()
    local success = exports["s1h_uipack"]:StartSkillbar({
        rounds = 3,
        keys   = { "E", "F", "R" }
    })

    if success then
        TriggerServerEvent("myScript:server:success")
    end
end)
```

***

**Example — easy (wide zone, slow bar) :**

```lua
CreateThread(function()
    local success = exports["s1h_uipack"]:StartSkillbar({
        rounds      = 2,
        speed       = 0.10,
        targetWidth = 80,
        shrink      = 3,
        keys        = { "E" }
    })

    if success then
        TriggerServerEvent("myScript:server:success")
    end
end)
```

***

**Example — hard (tiny zone, fast bar, numbers + letters) :**

```lua
CreateThread(function()
    local success = exports["s1h_uipack"]:StartSkillbar({
        rounds      = 6,
        speed       = 0.32,
        targetWidth = 25,
        shrink      = 12,
        keys        = { "W", "A", "S", "D", "1", "2", "3", "4" }
    })

    if success then
        TriggerServerEvent("myScript:server:success")
    end
end)
```

***

**Example — real-world usage :**

```lua
RegisterCommand("lockpick", function()
    CreateThread(function()
        local success = exports["s1h_uipack"]:StartSkillbar({
            rounds      = 4,
            speed       = 0.22,
            targetWidth = 45,
            shrink      = 10,
            keys        = { "E", "F", "R", "1", "2" }
        })

        if success then
            TriggerServerEvent("myScript:server:unlockDoor")
        else
            TriggerServerEvent("myScript:server:lockpickFailed")
        end
    end)
end, false)
```
