- Joined
- Sep 26, 2019
- Messages
- 41
- Reaction score
- 14
- First Language
- German
- Primarily Uses
- RMMV
i am using 2 states to kinda bind an enemy and an actor. that the enemy dies when the actor dies and the other way around. i am using this in the actors state
and its working perfectly. the enemy dies when the actor dies. but it wont work the other way around. thats the enemys state
i dont know how to call on actors
Code:
if (target.hp <= 0) {
var enemies = origin.opponentsUnit().aliveMembers();
for (var i = 0; i < enemies.length; ++i) {
var enemy = enemies[i];
if (enemy.isStateAffected(26)) {
enemy.startAnimation(161);
enemy.setHp(0);
enemy.clearResult();
enemy.performCollapse();
}
};
}
Code:
if (target.hp <= 0) {
var members = origin.???Unit().aliveMembers();
for (var i = 0; i < members.length; ++i) {
var actor = members[i];
if (actor.isStateAffected(25)) {
actor.startAnimation(161);
actor.setHp(0);
actor.clearResult();
actor.performCollapse();
}
};
}



