From 8690348917ebb881106d9c9536c8f05a3786f6d0 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sat, 6 Jul 2024 15:19:20 -0700 Subject: [PATCH] Update functions.lua --- client/functions.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/client/functions.lua b/client/functions.lua index c5f3b80..6364c36 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -9,18 +9,20 @@ function progressbar(text, time, anim) TriggerEvent('animations:client:EmoteCommandStart', {anim}) if progressbartype == 'oxbar' then if lib.progressBar({ duration = time, label = text, useWhileDead = false, canCancel = true, disable = { car = true, move = true},}) then - TriggerEvent('animations:client:EmoteCommandStart', {"c"}) if GetResourceState('scully_emotemenu') == 'started' then exports.scully_emotemenu:cancelEmote() + else + TriggerEvent('animations:client:EmoteCommandStart', {"c"}) end return true end elseif progressbartype == 'oxcir' then if lib.progressCircle({ duration = time, label = text, useWhileDead = false, canCancel = true, position = 'bottom', disable = { car = true,move = true},}) then - TriggerEvent('animations:client:EmoteCommandStart', {"c"}) if GetResourceState('scully_emotemenu') == 'started' then exports.scully_emotemenu:cancelEmote() - end + else + TriggerEvent('animations:client:EmoteCommandStart', {"c"}) + end return true end elseif progressbartype == 'qb' then @@ -29,14 +31,17 @@ function progressbar(text, time, anim) QBCore.Functions.Progressbar("drink_something", text, time, false, true, { disableMovement = true, disableCarMovement = true, disableMouse = false, disableCombat = true, disableInventory = true, }, {}, {}, {}, function()-- Done test = true - TriggerEvent('animations:client:EmoteCommandStart', {"c"}) if GetResourceState('scully_emotemenu') == 'started' then exports.scully_emotemenu:cancelEmote() + else + TriggerEvent('animations:client:EmoteCommandStart', {"c"}) end end, function() cancelled = true if GetResourceState('scully_emotemenu') == 'started' then exports.scully_emotemenu:cancelEmote() + else + TriggerEvent('animations:client:EmoteCommandStart', {"c"}) end end) repeat