From 8f76f245944a5dca776ea6332850364f6326bc76 Mon Sep 17 00:00:00 2001 From: Zerio Date: Sat, 25 May 2024 21:05:51 +0000 Subject: [PATCH] fix: make useitem fn fit qb-core changes --- server/functions.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/functions.lua b/server/functions.lua index 9cea1e8f1..872fcd8e0 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -162,9 +162,9 @@ exports('SetItemData', SetItemData) function UseItem(itemName, ...) local itemData = QBCore.Functions.CanUseItem(itemName) - local callback = type(itemData) == 'table' and (rawget(itemData, '__cfx_functionReference') and itemData or itemData.cb or itemData.callback) or type(itemData) == 'function' and itemData - if not callback then return end - callback(...) + if type(itemData) == "table" and itemData.func then + itemData.func(...) + end end exports('UseItem', UseItem)