# Progressbar

## MSK.Progress.Start

Shows a progressbar. `color` is optional and can be set in `config.lua`.

<mark style="color:red;">**Parameters**</mark>\
**duration** - `number <miliseconds>` - The time in miliseconds\
**text** - `boolean` - Text\
**color** - `string` - Color as hex - **Optional**

```lua
MSK.Progress.Start(duration, text, color)

-- Example 1
MSK.Progress.Start(5000, 'Progressing...') -- default color set in config.lua
Wait(5000)

-- Example 2
MSK.Progress.Start(5000, 'Progressing...', "#5eb131") -- custom color
Wait(5000)

-- As an Export:
exports.msk_core:Progressbar(duration, text, color)
```

<details>

<summary>Progressbar with specific data</summary>

<mark style="color:red;">**Parameters**</mark>\
**data** - `table` - Data for Progressbar

<mark style="color:green;">**Returns**</mark>\
**progressEnd** - `boolean` - if progress has ended or progress was stopped

<mark style="color:blue;">**Description**</mark>\
**duration** - `number <miliseconds>` - The time in miliseconds\
**text** - `boolean` - Text\
**color** - `string` - Color as hex - **Optional**\
**animation** - `table` - Animation data - **Optional**\
**disable** - `table` - Disable specific actions - **Optional**

```lua
MSK.Progress.Start(data)

-- Example
MSK.Progress.Start({
    duration = 5000,
    text = 'Progressing...',
    color = "#5eb131", -- Optional
    canCancel = true, -- If the Player can cancel the Progressbar
    useWhileDead = false, -- Cancel the Progressbar on player death
    useWhileCuffed = false, -- Cancel the Progressbar if player gets cuffed
    animation = {
        dict = 'timetable@gardener@filling_can',
        anim = 'gar_ig_5_filling_can',
        flags = 49, -- Optional
    },
    disable = {
        move = true, -- Disable Walk
        vehicle = true, -- Disable drive
        combat = true, -- Disable combat
    }
})
print('Progressbar ended or canceled')

-- As an Export:
exports.msk_core:Progressbar(data)
```

</details>

## MSK.Progress.Stop

Stops the current ProgressBar.

```lua
MSK.Progress.Stop()

-- As an Export:
exports.msk_core:ProgressStop()
```

## MSK.Progress.Active

Checks if the Progressbar is active

<mark style="color:green;">**Returns**</mark>\
**isActive** - `boolean` - whether the Progressbar is active

```lua
local isActive = MSK.Progress.Active()

-- As an Export:
local isActive = exports.msk_core:ProgressActive()
```
