Page 1 of 1
Console command for killing spawners?
Posted: Tue Aug 11, 2015 6:46 pm
by SkySo1dier
Guys, is there a console command for killing all spawners, biters, warms?
Re: Console command for killing spawners?
Posted: Wed Aug 12, 2015 12:11 am
by DaveMcW
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;
Re: Console command for killing spawners?
Posted: Wed Aug 12, 2015 7:19 am
by SkySo1dier
Thank you! This worked perfectly!
Re: Console command for killing spawners?
Posted: Fri May 06, 2016 10:00 am
by steinio
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