I've got a script on the kiwi nest that drops an egg when it's killed. Problem is, it also spawns a kiwi. This is what I've got. First spawns eggs over time around it, second is the default kiwi spawning script, third is my kill script which makes an egg when the nest is destroyed.
Anybody know what's wrong?
script=start
on:changeday {
//Spawn Eggs
if (random(2)==1){
if (count_inrange("item",143,25,"self")<$max){
local $xp,$zp;
$xp=getx("self");
$zp=getz("self");
$xp+=random(-15,15);
$zp+=random(-15,15);
create "item",143,$xp,$zp;
freevar $xp,$zp;
}
}
}
loop("count",$count) {
if (count_inrange("unit",26,$radius,"self")<$max){
create "unit",26,getx("self"),getz("self");
}
}
on:kill {
create "item",143,getx("self"),getz("self");
corona getx("self"),getz("self");
}
script=end
Thanks for the help.