Progress Bar
The ProgressBar module provides client-side progress bar UI. Bridges ox_lib, wasabi_uikit, lation_ui, and others.
Client Functions
GetResourceName
Returns the progress bar resource name.
local name = Bridge.ProgressBar.GetResourceName()
-- Returns: string (always "default")Description:
Returns the name of the ProgressBar module resource. Used for internal identification. Always returns "default" for the built-in ProgressBar module.
Open
Displays a progress bar. Returns a success boolean (true if completed, false if cancelled). An optional callback receives the same value.
local success = Bridge.ProgressBar.Open(options, cb, isQBInput)
-- Returns: boolean (true = completed, false = cancelled)| Parameter | Type | Description |
|---|---|---|
| options | table | Progress bar options (see below) |
| cb | function | Optional callback; receives success boolean (true if completed, false if cancelled) |
| isQBInput | boolean | Whether options are in QB format (optional) |
Options Format
| Field | Type | Description |
|---|---|---|
| duration | number | Duration in milliseconds |
| label | string | Text shown on the progress bar |
| canCancel | boolean | Whether the player can cancel the progress bar |
| useWhileDead | boolean | Allow progress while the player is dead (optional) |
| style | string | 'bar' or 'circle' where supported (optional, default 'bar') |
| disable | table | Controls to disable while active (see below) |
| anim | table | Animation to play while active (see below) |
| prop | table | Prop attached while active (see below) |
disable fields (all optional booleans):
| Field | Description |
|---|---|
| move | Disable player movement |
| car | Disable vehicle controls |
| combat | Disable combat controls |
| mouse | Disable mouse look / camera |
anim fields:
| Field | Type | Description |
|---|---|---|
| dict | string | Animation dictionary |
| clip | string | Animation clip name |
| flag | number | Animation flag (optional, default 49) |
prop fields:
| Field | Type | Description |
|---|---|---|
| model | string | Prop model name |
| bone | number | Bone index to attach to |
| pos | vector3 | Position offset |
| rot | vector3 | Rotation offset |
Pass prop as a single table, or as an array of up to two prop tables where supported.
Example (recommended)
Open awaits completion and returns success directly:
local success = Bridge.ProgressBar.Open({
duration = 5000,
label = 'Searching...',
canCancel = true,
disable = {
move = true,
car = true,
combat = true,
mouse = true
},
anim = {
dict = 'anim@amb@clubhouse@tutorial@bkr_tut_ig3@',
clip = 'machinic_loop_mechandler'
},
prop = {
model = 'prop_tool_spanner',
bone = 57005,
pos = vector3(0.12, 0.04, -0.01),
rot = vector3(10.0, 0.0, 0.0)
}
})
if success then
print('completed')
endExample (callback)
The optional callback still works and receives the same success boolean:
Bridge.ProgressBar.Open({
duration = 5000,
label = 'Searching...',
canCancel = true,
disable = {
move = true,
car = true,
combat = true,
mouse = true
},
anim = {
dict = 'anim@amb@clubhouse@tutorial@bkr_tut_ig3@',
clip = 'machinic_loop_mechandler'
},
prop = {
model = 'prop_tool_spanner',
bone = 57005,
pos = vector3(0.12, 0.04, -0.01),
rot = vector3(10.0, 0.0, 0.0)
}
}, function(success)
if success then
print('completed')
end
end)