Console command for killing spawners?
-
- Inserter
- Posts: 26
- Joined: Sat Jul 26, 2014 2:34 am
- Contact:
Console command for killing spawners?
Guys, is there a console command for killing all spawners, biters, warms?
Re: Console command for killing spawners?
You can't kill all spawners on an infinite map, but you can kill them in as big an area as you like.
Code: Select all
/c radius = 500;
p = game.player.position;
for _,type in pairs{"unit", "unit-spawner", "turret"} do;
enemies = game.get_surface(1).find_entities_filtered{area={{p.x-radius,p.y-radius},{p.x+radius,p.y+radius}}, type=type, force=game.forces.enemy};
for _,enemy in pairs(enemies) do enemy.destroy(); end;
end;
Last edited by DaveMcW on Wed Aug 12, 2015 8:08 am, edited 1 time in total.
-
- Inserter
- Posts: 26
- Joined: Sat Jul 26, 2014 2:34 am
- Contact:
Re: Console command for killing spawners?
Thank you! This worked perfectly!
Re: Console command for killing spawners?
Hello,
i used this and first wondered about no effect on map.
It would be useful to mention that radar has to rescan the map to see the effect.
Is there a command to respawn the enemies?
Greetings steinio
i used this and first wondered about no effect on map.
It would be useful to mention that radar has to rescan the map to see the effect.
Is there a command to respawn the enemies?
Greetings steinio