Im using RPG Maker MZ with some Visustella plugins. Wanted to create a shocked state, which would damage the user if it uses an attack. It works as I want it, however, when the user is killed by this damage from the Shocked state, the game throws an error:
Could anyone please help me with this ?
Could anyone please help me with this ?
JavaScript:
<JS Pre-Start Action>
if (this.isAttack()) {
let hpLoss = Math.floor(user.mhp * 0.55);
user.gainHp(-hpLoss);
user.startDamagePopup();
if (user.isDead()) {
this.subject().clearActions();
return; // Stop further execution of this action
}
}
</JS Pre-Start Action>