Hi, everyone. I try to make the state that can makes the owner revive after death by Yanfly's Buff & State Core, like Phoenix ring, so I write this JavaScript.
But, the effect didn't happen, my character died.
Where the wrong is? Please, can someone tell me?
Code:
<Custom Apply Effect>
if (target.isActor()) {
var i = 111 ;
if (target.hasState(i)) {
target.discardState(i);
target.startAnimation(42);
var hp = Math.floor(target.mhp * 0.1);
target.gainHp(hp);
target.startDamagePopup();
}
}
</Custom Apply Effect>
But, the effect didn't happen, my character died.
Where the wrong is? Please, can someone tell me?