- Joined
- Aug 27, 2017
- Messages
- 113
- Reaction score
- 12
- First Language
- English
- Primarily Uses
- RMMV
Hello,
I'm trying to create a paralyze state like the one in Pokemon (probability of not attacking) but it doesn't seem to work in MZ.
<JS Pre-Start Action>
// Set the paralyze success rate.
var paralyzeRate = 1.0;
// Make a random number check to see if paralyze passes...
if (Math.random() < paralyzeRate) {
// If it does, play the paralyze animation on the target.
user.startAnimation(64);
// Check for the user's current action...
if (user.currentAction()) {
// And make the user consume its resources.
user.useItem(user.currentAction().item());
}
// Clear the user's actions making the user lose the actions.
user.clearActions();
// Make the battle wait for the paralysis animation to finish playing.
BattleManager.actionWaitForAnimation();
}
</JS Pre-Start Action>
Thanks!
I'm trying to create a paralyze state like the one in Pokemon (probability of not attacking) but it doesn't seem to work in MZ.
<JS Pre-Start Action>
// Set the paralyze success rate.
var paralyzeRate = 1.0;
// Make a random number check to see if paralyze passes...
if (Math.random() < paralyzeRate) {
// If it does, play the paralyze animation on the target.
user.startAnimation(64);
// Check for the user's current action...
if (user.currentAction()) {
// And make the user consume its resources.
user.useItem(user.currentAction().item());
}
// Clear the user's actions making the user lose the actions.
user.clearActions();
// Make the battle wait for the paralysis animation to finish playing.
BattleManager.actionWaitForAnimation();
}
</JS Pre-Start Action>
Thanks!