Hello,
I am currently working on a skill that will roll a random number between 1-6 and apply a state based on the number rolled. Below is what I'm using and it seems to work most of the time, but occasionally there is a number rolled that won't apply a state. I'm not entirely sure how to check the random number output or what I need to adjust here. Any help would be appreciated!
<After Eval>
var roll = Math.floor(Math.random()*(6)+1)
if(roll==1){
target.addState(353);
}
if(roll==2){
target.addState(354);
}
if(roll==3){
target.addState(355);
}
if(roll==4){
target.addState(356);
}
if(roll==5){
target.addState(357);
}
if(roll==6){
target.addState(358);
}
</After Eval>
Thanks!
I am currently working on a skill that will roll a random number between 1-6 and apply a state based on the number rolled. Below is what I'm using and it seems to work most of the time, but occasionally there is a number rolled that won't apply a state. I'm not entirely sure how to check the random number output or what I need to adjust here. Any help would be appreciated!
<After Eval>
var roll = Math.floor(Math.random()*(6)+1)
if(roll==1){
target.addState(353);
}
if(roll==2){
target.addState(354);
}
if(roll==3){
target.addState(355);
}
if(roll==4){
target.addState(356);
}
if(roll==5){
target.addState(357);
}
if(roll==6){
target.addState(358);
}
</After Eval>
Thanks!