- Joined
- Feb 10, 2015
- Messages
- 123
- Reaction score
- 119
- First Language
- English
I'm trying to set each party member's MP to 0, if they are a specific class. I put the below snippet in the Battle Event for one of my troops. If I remove the if statement logic is iterates through all party members and sets MP to 0.
I've tried assigning the current class to a variable but I can't seem to get it to return the class using:
$gameParty.members[n].currentClass() or
$gameParty.members[n].isClass(gameClass)
I'm pretty sure I'm setting up assigning it to a variable incorrectly. I'm also pretty sure I'm setting up the if statement incorrectly. Currently I'm using:
When I was trying to assign the current class to a variable I was using:
Any help is appreciated.
I've tried assigning the current class to a variable but I can't seem to get it to return the class using:
$gameParty.members[n].currentClass() or
$gameParty.members[n].isClass(gameClass)
I'm pretty sure I'm setting up assigning it to a variable incorrectly. I'm also pretty sure I'm setting up the if statement incorrectly. Currently I'm using:
JavaScript:
var x = $gameParty.members().length;
for (i = 0; i < x; i++) {
if $gameParty.members()[i].isClass(2) {
$gameParty.members()[i].setMp(0);
}
}
JavaScript:
$gameVariables.setValue(12, $gameParty.members()[i].currentClass);