I'm using stacking else if statments to use different skills based off of specific variables, for some reason when adding a second if else statement it breaks all the previous ones as well? anyone have any idea why.
The code in question:
var subject = $gameParty.members()[0];
if($gameVariables.value($gameVariables.value(11)) == 0){
$gameMessage.add("Click"); }
else{ if($gameVariables.value($gameVariables.value(11)) == 1) {
subject.forceAction(216, -2);
BattleManager.forceAction(subject);
this.setWaitMode('action');}
else{ if($gameVariables.value($gameVariables.value(11)) == 2){
subject.forceAction(217, -2);
BattleManager.forceAction(subject);
this.setWaitMode('action');}
}
}
The code works when the last four lines aren't there.
The code in question:
var subject = $gameParty.members()[0];
if($gameVariables.value($gameVariables.value(11)) == 0){
$gameMessage.add("Click"); }
else{ if($gameVariables.value($gameVariables.value(11)) == 1) {
subject.forceAction(216, -2);
BattleManager.forceAction(subject);
this.setWaitMode('action');}
else{ if($gameVariables.value($gameVariables.value(11)) == 2){
subject.forceAction(217, -2);
BattleManager.forceAction(subject);
this.setWaitMode('action');}
}
}
The code works when the last four lines aren't there.