I will be sharing alot more NPC scripts here when I get them fully tested
Sometimes when your working with NPCs, you get orphaned ones while testing because you edited your script without killing the NPC first, and lose the key.
here is a small basic NPC removal script to remove NPCs without restarting sim...
(note: this will only remove NPC's you have created.)
Code:
//Kill NPC's from Region
float range= 512.0;
default
{
state_entry(){
llSetText("Rogue NPC Cleanup\n\n(Click me to remove\nall NPC's from region)",<1.0,1.0,0.0>,1);
}
touch_start(integer anumber) {
llSensor("",NULL_KEY,NPC, range ,PI);
}
sensor(integer detected){
integer i;
for (i = 0; i < detected; i++){
llSay(0,(string)llDetectedName(i)+" Is being Killed!!");
for (i = 0; i < detected; i++){
osNpcRemove (llDetectedKey(i));
}
}
}
}