From 222d5051d24967b51d6e3ad9c87aa33ceddab0bd Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Thu, 13 Jun 2024 22:12:37 -0700 Subject: [PATCH] Update functions.lua --- client/functions.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/functions.lua b/client/functions.lua index 7a348d3..ad4ba4d 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -142,12 +142,18 @@ end function GetCops(number) if number == 0 then return true end + local need = false + local nope = false QBCore.Functions.TriggerCallback('md-drugs:server:GetCoppers', function(amount) - - if amount >= number then return amount == true else Notify('You Need '.. number - amount .. ' More Cops To Do This', 'error') end + if amount >= number then need = true else Notify('You Need '.. number - amount .. ' More Cops To Do This', 'error') nope = true end end) + repeat + Wait(100) + until need or nope + if need then return true end end + function GetImage(img) if GetResourceState('ox_inventory') == 'started' then local Items = exports['ox_inventory']:Items()