Changing ox_inventory progressbar from ox_lib to custom

Hello im trying to change the progress bar from ox_lib to different one .
From what i read i have to change this
local success = (not item.usetime or noAnim or lib.progressBar({
to this
local success = (not item.usetime or noAnim or exports[‘progress’]:Progress({

It load but when im using item food or any there is no more animation or the item is not remove from inventory
is there more i need to do i read the doc and this is what i understand .
If someone can guide me or help me understand .

1 Like

remember me never to ask for help from ox community …

To integrate QBCore progressbar into ox_lib

  • First go into ox_lib/resource/interface/client/progress.lua
  • Then find function lib.progressBar(data)
  • And then replace that whole function code with mine here

function lib.progressBar(data)
while progress ~= nil do Wait(0) end

if not interruptProgress(data) then
        playerState.invBusy = true
        exports['progressbar']:Progress({
        name = "random_task",
        duration = data.duration,
        label = data.label,
        useWhileDead = false,
        canCancel = true,
        controlDisables = {
            disableMovement = false,
            disableCarMovement = false,
            disableMouse = false,
            disableCombat = false,
        },
     }, function(cancelled)
        if not cancelled then
            -- finished
            --SendNUIMessage({
                --action = 'progress',
                --data = {
                    --label = data.label,
                    --duration = data.duration
                    --duration = -100
                --}
            --})
            progress = nil
            playerState.invBusy = false
        else
            -- cancelled
            print("omg")
            -- Reset progress whether it's finished or cancelled
            progress = false
            Citizen.Wait(1000)
            progress = nil
            playerState.invBusy = false
        end
     end)

    return startProgress(data)
end

end

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.