# Progress Bar

`MSK Progress Bar` is a FiveM progress bar resource with icon support, callbacks, and optional cancellation.

It is designed to be used as a shared progress bar layer across MSK resources, providing a simple and consistent way to display timed actions to players.

With support for start, completion, cancel, and update callbacks, the resource is flexible, lightweight, and easy to integrate into any script.

### Features

* Simple shared progress bar system
* Font Awesome icon support
* Completion callback support
* Cancel callback support
* Update callback support
* Optional player cancellation with `X`
* Only one active progress bar at a time
* Lightweight export-based integration

### How it works

Any resource can start a progress bar by calling the `StartProgressBar` export with a duration, text, and optional icon.

When started, the progress bar appears on screen and counts down until it finishes.

If the progress bar completes naturally, the `OnComplete` callback is triggered.\
If cancellation is enabled and the player presses `X`, the progress bar stops and the `OnStop` callback is triggered instead.

### Included Pages

* Installation
* Configuration

### Requirements

Before using this resource, make sure all required dependencies are installed and started correctly.

### Notes

* Only one progress bar can be active at a time
* Progress bars can optionally be cancelled by the player
* The resource is designed to be used through exports
* Make sure the UI is built before deploying the resource


---

# 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://mskscripts.gitbook.io/mskscripts/scripts/progress-bar.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.
