Kongregate Developers

Warning: This function should ONLY be used if your game does not have a server for consuming item instances. If your game has a server component, please use the REST version.

Consuming user item instances

You can consume a limited-use item instance by using the useItemInstance method. This function takes the item instance ID (retrieved using the requestUserItemList function) and a callback function to be called when the operation is completed.

  • itemInstanceId:int - The ID of the item instance to consume
  • callback:Function - The callback function

Fields on response object passed to callback:

  • success:Boolean - True if successful
  • id:int - The ID of the item consumed

Example: Consume an item from the player's inventory

kongregate.mtx.useItemInstance(12345, onUseResult);

function onUseResult(result:Object):void{
  trace("Item use result successful: " + result.success);