View Single Post
  #2  
Old 07-29-2017, 04:00 AM
Kamaeru Kamaeru is offline
G2k1
Kamaeru's Avatar
Join Date: Dec 2001
Posts: 1,040
Kamaeru has much to be proud ofKamaeru has much to be proud ofKamaeru has much to be proud ofKamaeru has much to be proud ofKamaeru has much to be proud ofKamaeru has much to be proud of
You can basically add a class that you join via your baddy that contains a function which runs a timer each time the baddy dies. Or just add the timer in the script, but if you do what I'm saying you can add other functions for like making the baddy drop gralats or items when it dies.

This is the old function they used on Graal2001:

NPC Code:
function domonsterdeath() {
setTimer(45);
if (strlen(#a)>0) {
player.clientr.monsterskilled++;
if (strlen(#p(0))>0) {
setstring clientr.mkills#p(0),#v(strtofloat(#s(clientr.mkill s#p(0)))+1);
setstring clientr.kills#p(0),#v(strtofloat(#s(clientr.kills# p(0)))+1);
}
}



So however your baddy death is handled, lets just assume it's really basic and you play the death animation and then do:

NPC Code:

hide();
doMonsterDeath();



and then the timeout part of your code would make it initialize again, so if your initialization is on creation of the NPC then just put onCreated(); in the onTimeout function

sorry for mixing up gs1 and gs2
__________________
3DS friendcode: 1118-0226-7975

Last edited by Kamaeru; 07-29-2017 at 04:16 AM..
Reply With Quote