PDA

View Full Version : Kill every enemy present



Schwa
04-13-2008, 11:17 PM
This one should be easy for most of you... but I'm pretty new at this scripting thing.

I need a script that kills every enemy on the screen at once when run. This has to be done without just spawning a Kill All Enemies item on top of Link, because that method is way too inaccurate (sometimes if Link is moving he won't pick up the item). I'm surprised to have not found this script after searching the whole forum...

By the way, the script I'm looking for is actually going to be part of a bigger script I'm making, so you don't have to include the script declaration commands if you don't want to... as long as I can still tell which variables are global and which aren't.

Thanks for your help guys! ^_^

Gleeok
04-13-2008, 11:58 PM
Stick this in your script where you want it to activate;



int e = Screen->NumNPCs(); int i;
while(i++ < e){
npc kill=Screen->LoadNPC(i);
kill->HP=0;
}



Thanks for your help guys! ^_^

Your welcome.

Schwa
04-14-2008, 12:47 AM
You're awesome, Gleeok. :D I'm posting my newly finished script to the Showcase Forum, so have a look. ^_^