onRemoveThing

Getting triggered a thing is remove from the tile.

Prototypes
onRemoveThing(callback) -- callback = function(tile, thing)
Parameters
    • function(tile, thing):callback function
      • tile: tile object.
      • thing: thing object. can be creature, item, effect or text.
Usage
local playerTile = g_map.getTile(pos()) -- get current tile
onRemoveThing(function(tile, thing)
    local goldItem = findItem(3031) -- search for gold
    if goldItem then
      g_game.move(thing, pos(), 1) -- drop the gold
    end
  end)