Forum

> > Stranded II > Scripts > Kill units in a certain range
Forums overviewStranded II overview Scripts overviewLog in to reply

English Kill units in a certain range

1 reply
To the start Previous 1 Next To the start

old Kill units in a certain range

Stranded_Guy2910
User Off Offline

Quote
I'm having problems with this script. I want to kill all the units with the raptor behaviour in a certain range. I tried this script:
1
2
3
closemenu;
$unit=(count_behaviourinrange("unit","raptor",300));
kill $unit;

This event happends when I click on the button of my dialogue. The problem is that when I click on the button I die instead of the raptor unit.

old Re: Kill units in a certain range

DC
Admin Off Offline

Quote
count_behaviourinrange - do you really think that this command returns a unit ID?
also how is one single call of "kill $unit" supposed to kill more than one single unit?

what you need here is a loop which loops over units, checks the distance and kills them if they are in range.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview