Orbit StudiosOrbit Studios
Orbit Studios Resourcesorbit-dynamichud-v2Interface APIs

Progress Bar

Run blocking DynamicHUD actions with controls, animations, props, and ox_lib-compatible calls.

Progress Bar

progressBar yields the calling Lua thread and returns true when the duration completes. It returns false when cancelled, interrupted by a disallowed ped state, timed out, or rejected because another progress action is active.

Client export
local completed = exports['orbit-dynamichud-v2']:progressBar({
    label = 'Repairing vehicle',
    description = 'Keep the area clear.',
    duration = 5000,
    canCancel = true,
    keybind = 'X',
    disable = {
        move = true,
        car = true,
        combat = true,
        sprint = true
    },
    anim = {
        dict = 'mini@repair',
        clip = 'fixing_a_ped',
        flag = 49
    }
})

if completed then
    TriggerServerEvent('my-resource:finishRepair')
end

Options

FieldTypeDefaultDescription
idstring?generatedRun ID used to match completion and cancellation.
labelstring?emptyMain text.
descriptionstring?emptySupporting text.
labelTranslationstring?noneFrontend locale key used instead of label when found.
descriptionTranslationstring?noneFrontend locale key used instead of description when found.
durationnumber?3000Milliseconds. Supply it explicitly; Lua adds a two-second watchdog grace period.
canCancelboolean?trueWhether the player can cancel. cancellable is an alias.
keybindstring?"X"Key shown in the interface. cancelKey is an alias.
cancelControlnumber?derivedGTA control ID. Use it when a custom key label has no built-in mapping.
disabletable?noneControl groups disabled while active.
animtable?noneAnimation dictionary/clip or scenario.
prop`tabletable[]?`none
useWhileDeadboolean?falseAllow progress while dead or fatally injured.
allowRagdollboolean?falseAllow progress while ragdolling.
allowSwimmingboolean?falseAllow progress while swimming or underwater.
allowCuffedboolean?falseAllow progress while cuffed.
allowFallingboolean?falseAllow progress while falling.

Supported disable keys are move, car, combat, mouse, and sprint.

Animations and scenarios

Animation
anim = {
    dict = 'amb@world_human_hammering@male@base',
    clip = 'base',
    blendIn = 3.0,
    blendOut = 1.0,
    duration = -1,
    flag = 49,
    playbackRate = 0.0,
    lockX = false,
    lockY = false,
    lockZ = false
}
Scenario
anim = {
    scenario = 'WORLD_HUMAN_WELDING',
    playEnter = true
}

anim is accepted as an alias for clip; flags is accepted as an alias for flag.

Props

prop = {
    model = 'prop_tool_box_04',
    bone = 60309,
    pos = vec3(0.0, 0.0, 0.0),
    rot = vec3(0.0, 0.0, 0.0),
    rotOrder = 0
}

model may be a model name or hash. pos and rot accept vector3, named { x, y, z } tables, or numeric arrays. Loaded animations and spawned props are cleaned up when the action ends or the resource stops.

State and cancellation

if exports['orbit-dynamichud-v2']:progressActive() then
    exports['orbit-dynamichud-v2']:cancelProgress()
end

ox_lib drop-in replacement

client/orbit_progress.lua
lib = lib or {}

lib.progressBar = function(data)
    return exports['orbit-dynamichud-v2']:progressBar(data)
end

-- Keeps existing progressCircle calls functional using DynamicHUD's progress view.
lib.progressCircle = lib.progressBar

lib.progressActive = function()
    return exports['orbit-dynamichud-v2']:progressActive()
end

lib.cancelProgress = function()
    return exports['orbit-dynamichud-v2']:cancelProgress()
end

The data structure and boolean return behavior are compatible with ox_lib. DynamicHUD provides one progress presentation, so both ox_lib entry points render the DynamicHUD progress bar and progressCircle.position has no visual effect.

The local event orbit-dynamichud:progressBarOver receives the NUI result table. Use the export return value for ordinary gameplay logic.

On this page