Not finding it.
Here is my current code:
Code: Select all
-- Detect killing a Unit spawner.
if event.entity.type == "unit-spawner" and event.entity.force == game.forces.enemy then
for i = 1, #game.players, 1 do
player = game.players[i]
if player.connected and player.character.valid then
player.surface.set_multi_command{command = {type=defines.command.attack, target=player.character, distraction=defines.distraction.by_enemy},unit_count = (20+math.floor(game.evolution_factor*100/#game.players)), unit_search_distance = 600}
end
end
end
