Yanfly Target Core Help!

This is on what i am working for.... that suposed to attack the highest hp target... but sometime the enemy attack two time 🙁

BTW how can i creat a spoil?

<Target: 1 Random Foes>



<Custom Target Eval>

if ($gameActors.actor(1).hp > $gameActors.actor(2).hp) {

if ($gameActors.actor(1).hp > $gameActors.actor(3).hp) {

if ($gameActors.actor(1).hp > $gameActors.actor(4).hp) {

var t = 1

}

else {

var t = 4

}

}

else {

if ($gameActors.actor(3).hp > $gameActors.actor(4).hp){

var t = 3

}

else {

var t = 4

}

}

}

else {

if ($gameActors.actor(2).hp > $gameActors.actor(3).hp) {

if ($gameActors.actor(2).hp > $gameActors.actor(4).hp) {

var t = 2

}

else {

var t = 4

}

}

else {

if ($gameActors.actor(3).hp > $gameActors.actor(4).hp) {

var t = 3

}

else {

var t = 4

}

}

}

var member = $gameActors.actor(t);

targets.push(member);

</Custom Target Eval>

I've moved this thread to Plug-In support. Thank you.

The targets.push line adds to the existing targets of the skill. Remove the <Target: 1 Random Foes> tag and set the skill's scope to "None" in the database. =)
The targets.push line adds to the existing targets of the skill. Remove the <Target: 1 Random Foes> tag and set the skill's scope to "None" in the database. =)

Ah thank you 🙂

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-target-core-help.92693/