API & configuration
exports['fr_progressbar']:Start(opts) → id
Starts a new progress bar. If one is already running it is silently cancelled first.
Options
| Option | Type | Required | Description |
|---|---|---|---|
label | string | ✅ | Text shown in the bar |
duration | number | ✅ | Duration in milliseconds |
icon | string | — | Icon name or raw <svg> markup |
color | string | — | 'blue' | 'red' | 'green' | 'yellow' (default: 'blue') |
canCancel | boolean | — | Player can press the cancel key (default: true) |
cancelOnMove | boolean | — | Cancels when the player moves (default: false) |
cancelOnDeath | boolean | — | Cancels on death (default: Config.CancelOnDeath) |
onComplete | function | — | Fired when the bar finishes naturally |
onCancel | function | — | Fired when cancelled for any reason |
Returns the bar's id string, or nil if duration is <= 0.
exports['fr_progressbar']:Stop(id?)
Stops a running bar programmatically. Fires onCancel unless the bar does not exist.
exports['fr_progressbar']:Stop() -- stop any active bar
exports['fr_progressbar']:Stop(id) -- stop a specific bar by id
exports['fr_progressbar']:IsActive() → boolean
Returns true if a bar is currently running.
Usage examples
Healing (green, cancel on move)
exports['fr_progressbar']:Start({
label = 'Applying bandage...',
duration = 4000,
icon = 'medical',
color = 'green',
cancelOnMove = true,
onComplete = function()
-- apply heal
end,
})
Criminal action (red, cancellable)
exports['fr_progressbar']:Start({
label = 'Hacking terminal...',
duration = 12000,
icon = 'lock',
color = 'red',
canCancel = true,
onComplete = function() end,
onCancel = function() end,
})
Configuration (config.lua)
| Key | Default | Description |
|---|---|---|
Config.Locale | 'es' | UI language: 'en' or 'es' |
Config.CancelKey | 194 | FiveM control index for the cancel key (Backspace) |
Config.CancelKeyLabel | 'Backspace' | Human-readable label shown in the bar hint |
Config.MoveThreshold | 1.5 | Metres a player must move to trigger cancelOnMove |
Config.CancelOnDeath | true | Global default; individual calls can override with cancelOnDeath = false |