From 99e8afe653b0133716ebc114bc971406a220802a Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Mon, 3 Jun 2024 19:51:30 -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 7f5652c..7a348d3 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -19,14 +19,19 @@ local dispatch = Config.Dispatch return true end elseif progressbartype == 'qb' then - local test = false + local test = false + local cancelled = false 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"}) - end) - Wait(time + 200) - if test then return true else Wait(400) if test then return true end end + end, function() + cancelled = true + end) + repeat + Wait(100) + until cancelled or test + if test then return true end else print"dude, it literally tells you what you need to set it as in the config" end