on_picked_up_item filter for only one item
Posted: Thu Apr 19, 2018 12:55 pm
Hello ! I have a item named "map" and I would like it as soon as the person picks it off the floor, it executes this routine, but I can not understando how to filter to only appear when the player picks the item "map"

Thanks a lot !!script.on_event(defines.events.on_picked_up_item, function(event)
local player = game.players[event.player_index]
player.force.chart(player.surface, {{player.position.x - 300, player.position.y - 300}, {player.position.x + 300, player.position.y + 300}})
if (#game.players <= 1) then
game.show_message_dialog{text = {"msg-map"}}
else
player.print({"msg-map"})
end
end)
