Basically is get items that are in table in tile x and create item according to the item on the tile.
Lua:
local item = {[neededitem] = reward, [neededitem] = reward}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local tile = Tile(Position(32342, 32236, 6))
if tile:getItemById(item, itemid) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Test')
Game.createItem([item.reward], 1, Position(32344, 32236, 6))
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Test')
end
return true
end