# Progress bar

## How to replace it?

You can use Drugs Creator [modules](https://documentation.jaksam-scripts.com/drugs-creator/modules "mention") if you want to use your own progress bar

## Use in external scripts

If you like the default progress bar of the script, and you want to use it in external scripts, this is the event

```lua
TriggerEvent("drugs_creator:startProgressBar", timeInMS, text, hexColor)
```

### Parameters

| Name       | Data type | Description                                                                                                     |
| ---------- | --------- | --------------------------------------------------------------------------------------------------------------- |
| `timeInMS` | integer   | Duration of the progress bar in milliseconds                                                                    |
| `text`     | string    | The text that will be shown with the progressbar                                                                |
| `hexColor` | string    | The color of the progressbar in hex code (example `#70f2b4`). Can be `nil` to use the default one of the script |

### Example

```lua
-- This will create a command to show a red progressbar
-- /progressbar 5000 Hello
RegisterCommand("progressbar", function(playerId, args) 
    TriggerEvent("drugs_creator:startProgressBar", tonumber(args[1]), args[2], "#ff0000")
end)
```


---

# 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://documentation.jaksam-scripts.com/drugs-creator/client/replace-disable-default-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.
