Progress Bar

A progress bar with optional animation and input blocking.


startProgressbar

startProgressbar(data, callback)

Also available as an export:

exports['koja-lib']:startProgressbar(data, callback)

Parameters

Field
Type
Default
Description

label

string

"Loading..."

Title text (alias: title)

description

string

"Please wait..."

Body text (alias: text)

duration

number

5000

Duration in milliseconds (alias: time)

cancelable

boolean

false

Player can press X to cancel

animation

table?

Ped animation to play

animation.dict

string

Animation dictionary

animation.name

string

Animation name

animation.flag

number

1

Animation flag

inputBlock

table?

Keys to block during the progress bar

inputBlock.keys

string[]

Key names to disable (e.g. {"E", "SPACE"})

Callback

callback(success: boolean) — called when the bar finishes (true) or is cancelled (false).


cancelProgressbar

Cancel and hide the active progress bar immediately.


Theme

Appearance is controlled by Config.UI.ProgressBar in the config file:


Examples

Basic progress bar

With animation and cancelable


Key Names Reference

Common keys you can use in inputBlock.keys:

ESC, F1F10, TAB, ENTER, SPACE, BACKSPACE AZ, 09 LEFT, RIGHT, TOP, DOWN LEFTSHIFT, LEFTCTRL, LEFTALT HOME, PAGEUP, PAGEDOWN, DELETE

Last updated