1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-07-13 23:24:01 +02:00
parent 86bbde2668
commit c33e21ef5b
2 changed files with 4 additions and 16 deletions

View file

@ -7,20 +7,8 @@ end
-- Function to check if player has an item
local function HasItem(source, itemName, amount)
local items = exports["tgiann-inventory"]:GetPlayerItems(source)
if not items then return false end
local count = 0
for _, item in pairs(items) do
if item.name == itemName then
count = count + item.count
if count >= amount then
return true
end
end
end
return false
local itemCount = exports["tgiann-inventory"]:GetItemCount(source, itemName)
return itemCount >= amount
end
-- Event for client to check if player has an item