Created
September 28, 2022 03:32
-
-
Save IdrisDose/61e0b07db0dd3a9c173aa98e07aadde0 to your computer and use it in GitHub Desktop.
Add onTick event for QB Progress bar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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