I want a random battle sound to play, but it depends on which actors are in the team (and alive).
So for example if I have Son Goku, Pikachu and Princess Peach in the team but Pikachu is dead, then either Son Goku's sound effect of Peach's would be playing. This is what I have:
Code:
allout = new Array();
if ($gameActors.actor(2).isBattleMember() && $gameActors.actor(1).isStateAffected(1) == false) {allout.push("1");}
if ($gameActors.actor(2).isBattleMember() && $gameActors.actor(2).isStateAffected(1) == false) {allout.push("2");}
if ($gameActors.actor(3).isBattleMember() && $gameActors.actor(3).isStateAffected(1) == false) {allout.push("3");}
actorToUse = allout[Math.floor(Math.random() * allout.length)];
if (actorToUse == 1) {BattleSoundManager.playSe(allout_1_1)}
if (actorToUse == 2) {BattleSoundManager.playSe(allout_2_1)}
if (actorToUse == 3) {BattleSoundManager.playSe(allout_3_1)}I get a lot of errors saying: "actorToUse is not defined" and "allout is not defined" ;_;

