Yes, I know the example is about an item, not an entity, but the category shouldn't matter here.
from the wiki seems easy enough:but that is because you know you're looking for iron-plates and can use a constant in your code. But how about the following?game.print({"item-name.iron-plate"})
Code: Select all
script.on_event(defines.events.on_built_entity, function(event)
local entity = event.created_entity
local vehicles = entity.surface.find_entities_filtered{area = area.create(entity.position,1), type = "car"}
for i in pairs(vehicles) do
local found_vehicle = vehicles[i]
game.print("Your vehicle is a " .. {found_vehicle.localised_name})
end
end
