diff --git a/resources/[jobs]/[crime]/r_moneywash/src/client/main.lua b/resources/[jobs]/[crime]/r_moneywash/src/client/main.lua index 0ecb02bbc..5b0d944e1 100644 --- a/resources/[jobs]/[crime]/r_moneywash/src/client/main.lua +++ b/resources/[jobs]/[crime]/r_moneywash/src/client/main.lua @@ -84,19 +84,28 @@ local function buildMarkedBillsMenu() ClearPedTasks(entities.npc) PlayPedAmbientSpeechNative(entities.npc, 'GENERIC_HOWS_IT_GOING', 'SPEECH_PARAMS_FORCE') local playerInventory = lib.callback.await('r_moneywash:getPlayerInventory', false) - for _, item in pairs(playerInventory) do - if item.name == Cfg.Options.Currency then - table.insert(options, { - title = item.label, - description = _L('marked_worth', item.metadata.worth), - icon = 'fas fa-money-bill-wave', - iconColor = '#fa5252', - onSelect = function() - giveExchangeOffer(item.count, item.metadata) - end, - }) +for _, item in pairs(playerInventory) do + if item.name == Cfg.Options.Currency then + -- Add a check for metadata + local description = "" + if item.metadata and item.metadata.worth then + description = _L('marked_worth', item.metadata.worth) + else + description = _L('marked_worth', item.count) -- Fallback to using the count or another appropriate value end + + table.insert(options, { + title = item.label, + description = description, + icon = 'fas fa-money-bill-wave', + iconColor = '#fa5252', + onSelect = function() + giveExchangeOffer(item.count, item.metadata) + end, + }) end +end + lib.registerContext({ id = 'moneywash_markedbills', title = _L('money_wash'),