oxclient
lib.progressBar
ox client documentation with a FiveM Lua example.
Summary
Shows a progress bar and yields until it finishes or is cancelled. Returns whether it completed. Standard for timed actions (lockpicking, crafting).
Returns
boolean — true if completed, false if cancelled.
Parameters
optionstable{ duration, label, canCancel, disable, anim }Example
-- CLIENT
if lib.progressBar({
duration = 5000,
label = 'Lockpicking…',
canCancel = true,
}) then
-- completed
else
-- cancelled
endCommon pitfalls
- It yields — call it inside a thread/coroutine.
- Always check the return so a cancelled action doesn't still give the reward.
- Requires ox_lib.
Related functions
Related guides
FiveM scripts done right
Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.
Browse Scripts →