Progress
A progress bar or circle that blocks until done — with ped animation, attached props and cancellation.
A progress bar or circle that blocks until done — with ped animation, attached props and cancellation.
lib.progressBar shows a bar (and lib.progressCircle a circle) and blocks until it finishes
or is interrupted. It returns true if it completed, false if cancelled.
local finished = lib.progressBar({
label = 'Searching the bag',
duration = 3000,
canCancel = true,
})
if not finished then return endlib.progressBar(data) and lib.progressCircle(data) share a ProgressProps:
durationnumberrequiredDuration in milliseconds.
labelstringoptionalText shown on the bar.
positionstringoptionalCircle only: middle or bottom (default bottom).
canCancelbooleanoptionalLet the player cancel with X.
animtableoptionalPed animation: { dict, clip, flag?, … } or { scenario }.
proptable | table[]optionalAttached prop(s): { model, bone?, pos, rot }.
disabletableoptionalControls to block: { move?, sprint?, car?, combat?, mouse? }.
allowRagdoll, allowFalling, allowSwimming, allowCuffed, useWhileDead keep it running
through those states (off by default). Returns true if completed, false otherwise.
local ok = lib.progressCircle({
label = 'Lockpicking',
duration = 5000,
position = 'middle',
canCancel = true,
anim = { dict = 'mp_common', clip = 'givetake1_a', flag = 49 },
prop = { model = 'prop_tool_screwdvr01', bone = 28422, pos = vector3(0, 0, 0), rot = vector3(0, 0, 0) },
disable = { move = true, car = true, combat = true },
})lib.cancelProgress() cancels the active one; lib.progressActive() returns a boolean.
One progress at a time — a second call returns false. Death, ragdoll, cuffs, falling or swimming interrupt it (return false) unless you allow them explicitly. Always check the returned boolean, and call it inside a CreateThread (it blocks).