So basically i want this skill, when activated, to kill it's user after the ability is finished attacking the entire team, what is the best way to do this?
How to make enemies kill themselves after using specific skill
RPG Maker MZ Supportyou can use a common event to get the actor ID / enemy index of the last battler to act and apply the death state to them
Try to put a.setHp(0) next to the damage to see if it matches your idea, like:
Code:
200;a.setHp(0)
iirc setHp triggers a refresh, so the skill will hit the first target, kill the user, and wouldnt hit the rest of the targets
Edit: also skills do the damage of the last statement's value. you'd want to put the 200 after the setHp call. setHp last would make the skill do 0 damage since its value would be undefined
Do i use Force Action here? It demands a specific target
no. for actors, you can use the change state command and use the variable with the actor's ID to specify them.
I thought the change enemy state command had a variable option, but i was mistaken. at that point you could use a script call
Code:
$gameTroop.members()[$gameVariables.value(x)-1].addState(1);
You would need an actor version and an enemy version of the skill get the right battler each time.
you would need the info for the last battler to act, not the one targeted
Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-enemies-kill-themselves-after-using-specific-skill.180674/