Skip to content

Instantly share code, notes, and snippets.

@IdrisDose
Created September 28, 2022 03:32
Show Gist options
  • Save IdrisDose/61e0b07db0dd3a9c173aa98e07aadde0 to your computer and use it in GitHub Desktop.
Save IdrisDose/61e0b07db0dd3a9c173aa98e07aadde0 to your computer and use it in GitHub Desktop.
Add onTick event for QB Progress bar
function QBCore.Functions.Progressbar(name, label, duration, useWhileDead, canCancel, disableControls, animation, prop, propTwo, onFinish, onCancel, onTick)
exports['progressbar']:ProgressWithTickEvent({
name = name:lower(),
duration = duration,
label = label,
useWhileDead = useWhileDead,
canCancel = canCancel,
controlDisables = disableControls,
animation = animation,
prop = prop,
propTwo = propTwo,
}, function()
if onTick ~= nil then
onTick()
end
end,function(cancelled)
if not cancelled then
if onFinish then
onFinish()
end
else
if onCancel then
onCancel()
end
end
end)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment