From 6d6efc88edb69f0899f7e2c3c8783715d148da19 Mon Sep 17 00:00:00 2001 From: AJ <66404074+ihyajb@users.noreply.github.com> Date: Sun, 29 Aug 2021 12:35:40 -0400 Subject: [PATCH] fix: HasItem always returning true --- server/events.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/events.lua b/server/events.lua index a8cafc6..3a562e6 100644 --- a/server/events.lua +++ b/server/events.lua @@ -257,7 +257,7 @@ QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items, am for i, _ in pairs(items) do if i then finalcount = finalcount + 1 end end - local item = Player.Functions.GetItemsByName(k) + local item = Player.Functions.GetItemByName(k) if item ~= nil then if item.amount >= v then count = count + 1 @@ -268,7 +268,7 @@ QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items, am end else finalcount = #items - local item = Player.Functions.GetItemsByName(v) + local item = Player.Functions.GetItemByName(v) if item ~= nil then if amount ~= nil then if item.amount >= amount then @@ -287,7 +287,7 @@ QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items, am end end else - local item = Player.Functions.GetItemsByName(items) + local item = Player.Functions.GetItemByName(items) if item ~= nil then if amount ~= nil then if item.amount >= amount then