Progress Bar

Progress bar with optional multi-step feature & more.

Options

OptionTypeRequiredDefaultDescription
labelstringYesnilProgress bar label
descriptionstringNonilProgress description (overridden by steps)
durationnumberYesnilDuration in milliseconds
iconstringNonilFontAwesome icon class
iconColorstringNo'#71717A'Icon color (hex)
iconAnimationstringNonilIcon animation: 'spin', 'spinPulse', 'spinReverse', 'pulse', 'beat', 'fade', 'beatFade', 'bounce', 'shake'
colorstringNo'#3B82F6'Progress bar color (hex)
stepstableNo{}Array of step objects with descriptions
canCancelbooleanNotrueWhether progress can be cancelled with X key
useWhileDeadbooleanNofalseAllow progress while player is dead
allowRagdollbooleanNofalseAllow progress while player is ragdolled
allowCuffedbooleanNofalseAllow progress while player is cuffed
allowFallingbooleanNofalseAllow progress while player is falling
allowSwimmingbooleanNofalseAllow progress while player is swimming
animtableNonilSee “Animations” below
proptableNonilSee “Props” below
disabletableNonilControls to disable during progress

Animations

OptionTypeRequiredDefaultDescription
dictstringNo*nilAnimation dictionary
clipstringYesnilAnimation clip name
flagnumberNo49Animation flags
blendInnumberNo3.0Blend in speed
blendOutnumberNo1.0Blend out speed
durationnumberNo-1Animation duration (-1 for loop)
playbackRatenumberNo0Playback rate
lockXbooleanNofalseLock X axis
lockYbooleanNofalseLock Y axis
lockZbooleanNofalseLock Z axis
scenariostringNo*nilScenario name (alternative to dict/clip)
playEnterbooleanNotruePlay enter animation for scenarios

*Either dict or scenario is required if using animations.

Props

OptionTypeRequiredDefaultDescription
modelstringYesnilProp model hash
bonenumberNo60309Bone index to attach to
postableYesnilPosition offset {x, y, z}
rottableYesnilRotation offset {x, y, z}
rotOrdernumberNo0Rotation order

Disable

OptionTypeDefaultDescription
movebooleanfalseDisable player movement
sprintbooleanfalseDisable sprinting only
carbooleanfalseDisable vehicle controls
combatbooleanfalseDisable combat actions
mousebooleanfalseDisable mouse look

Functions

-- Show progress bar
local success = exports.lation_ui:progressBar(data)
 
-- Check if progress is active
local isActive = exports.lation_ui:progressActive()
 
-- Cancel active progress
exports.lation_ui:cancelProgress()

Return Values

  • progressBar(): true if completed, false if cancelled/failed
  • progressActive(): true if progress is active, false otherwise

Example

-- Basic progress bar
if exports.lation_ui:progressBar({
    label = 'Submitting',
    description = 'Please wait while we process your data...',
    duration = 5000,
    icon = 'fas fa-download',
}) then print('Progress completed') else print('Cancelled/incomplete') end
-- Progress with multi-step feature
if exports.lation_ui:progressBar({
    label = 'Initializing Hack',
    duration = 10000,
    icon = 'fas fa-crosshairs',
    iconColor = '#EF4444',
    color = '#EF4444',
    steps = {
        { description = 'Connecting to server...' },
        { description = 'Bypassing security protocols...' },
        { description = 'Establishing secure connection...' },
        { description = 'Hack in progress...' }
    }
}) then print('Progress completed') else print('Cancelled/incomplete') end
-- Progress with animation and props
if exports.lation_ui:progressBar({
    label = 'Robbing Store',
    description = 'Looting cash from the register...',
    duration = 30000,
    icon = 'fas fa-money-bill-wave',
    iconColor = '#10B981',
    color = '#10B981',
    useWhileDead = false,
    disable = { 
        car = true,
        move = true,
        combat = true
    },
    anim = {
        dict = 'anim@heists@ornate_bank@grab_cash',
        clip = 'grab'
    },
    prop = {
        model = 'p_ld_heist_bag_s',
        bone = 40269,
        pos = vec3(0.0454, 0.2131, -0.1887),
        rot = vec3(66.4762, 7.2424, -71.9051)
    }
}) then print('Progress completed') else print('Cancelled/incomplete') end