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)
ParameterTypeDescription
optionstableProgress bar options (see below)
cbfunctionOptional callback; receives success boolean (true if completed, false if cancelled)
isQBInputbooleanWhether options are in QB format (optional)

Options Format

FieldTypeDescription
durationnumberDuration in milliseconds
labelstringText shown on the progress bar
canCancelbooleanWhether the player can cancel the progress bar
useWhileDeadbooleanAllow progress while the player is dead (optional)
stylestring'bar' or 'circle' where supported (optional, default 'bar')
disabletableControls to disable while active (see below)
animtableAnimation to play while active (see below)
proptableProp attached while active (see below)

disable fields (all optional booleans):

FieldDescription
moveDisable player movement
carDisable vehicle controls
combatDisable combat controls
mouseDisable mouse look / camera

anim fields:

FieldTypeDescription
dictstringAnimation dictionary
clipstringAnimation clip name
flagnumberAnimation flag (optional, default 49)

prop fields:

FieldTypeDescription
modelstringProp model name
bonenumberBone index to attach to
posvector3Position offset
rotvector3Rotation offset

Pass prop as a single table, or as an array of up to two prop tables where supported.

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')
end

Example (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)