Hello,
I am trying to create a code which will execute, depending on if specific enemies are members of a troop. I came up with the code below, however only thing it does, is that it activates switch 283, even if specified enemies(3, 8, 9, 11) are not in a troop.
I am trying to create a code which will execute, depending on if specific enemies are members of a troop. I came up with the code below, however only thing it does, is that it activates switch 283, even if specified enemies(3, 8, 9, 11) are not in a troop.
for (i = 0; i < 6; i++) {
if ($gameTroop.members()[i].enemyId() == 3 || 8 || 9 || 11) {
$gameSwitches.setValue(283, true)
} else if ($gameTroop.members()[i].enemyId() == 5 || 10 || 12 || 14) {
$gameSwitches.setValue(284, true)
} else if ($gameTroop.members()[i].enemyId() == 4 || 6 || 13) {
$gameSwitches.setValue(285, true)
} else if ($gameTroop.members()[i].enemyId() == 2 || 7) {
$gameSwitches.setValue(286, true)
}
}