onUse

Getting triggered when player uses an item.

Prototypes
onUse(callback) -- callback = function(pos, itemId, stackPos, subType)
Parameters
    • function(pos, itemId, stackPos, subType): callback function
      • pos: item position object x, y and z.
      • itemId: client side item id.
      • stackPos: current item position on stack
      • subType: integer
Usage
onUse(function(pos, itemId, stackPos, subType)
	print(itemId .. " was used")
end)