Skip to main content

CheckInventoryForItem

Check if the player has the item in his inventory

Parameters

NameParameter
sourceThe source of the player
itemItem name
amountAmount of the item to check for

Return Type

Boolean

Invoke

local framework = exports["ssdev_framework"]:GetFramework()
framework:CheckInventoryForItem(source, item, amount)

Example

local framework = exports["ssdev_framework"]:GetFramework()
local hasItem = framework:CheckInventoryForItem(1, "sandwich", 1)
print("Player has 1 sandwich: " .. tostring(hasItem))
Bare in mind

The additional parameters may not be used depending on your framework.