Hi.
In my game I want to make it so that the player as well as enemies receive a certain state whenever they successfully land a crit or target an opponent's weakness. I'm using Yanfly's Skill Rewards plugin to do this. However, since the state in question is quite powerful, I want it to have a fairly low chance of applying. This is something that Yanfly's plugin can't do out of the box.
I'm using this code but it doesn't seem to be working. I know basically nothing about Javascript. Is there an error somewhere?
In my game I want to make it so that the player as well as enemies receive a certain state whenever they successfully land a crit or target an opponent's weakness. I'm using Yanfly's Skill Rewards plugin to do this. However, since the state in question is quite powerful, I want it to have a fairly low chance of applying. This is something that Yanfly's plugin can't do out of the box.
Code:
} else if (data.match(/ADD STATE[ ](\d+)/i)) {
if (Math.random() < 0.3);
user.addState(stateId);
animation = animation || addStateAnimation;
I'm using this code but it doesn't seem to be working. I know basically nothing about Javascript. Is there an error somewhere?