Inventory:getItemCount

Inventory:getItemCount(uniqueID, onlyMain) This function returns the number of items that existing in the inventory. This function returns integer.

Arguments

 * String uniqueID
 * Boolean onlySearchMain

Return Values
A Number of the items
 * Integer

Examples
If player has a skull in their inventory, it will print how many they have. for k,v in pairs(player.GetAll) do         print(v:getChar:getInv:getItemCount( "skull" )) end

Can be used to check if a player has a certain amount of items in a table. This will return false if the player has less items in their inventory than defined in the table. local items = { ["skull"] = 5, ["bone"] = 3, }    for k,v in pairs( items ) do          if player:getChar:getInv:getItemCount( k ) < v then return false end end