Specific Percentage Range Command

Hey @imlightbringer!

It’s not too far off the other type of commands you might have seen.

As explained here, you can generate a number between two values — both included — like this:

Math.floor(Math.random() * (max - min + 1) ) + min;

With that in mind, here’s how you can write the command to fit your needs, and you just need to replace MIN_VALUE and MAX_VALUE by the numbers you want:

$(eval min = MIN_VALUE; max = MAX_VALUE; Math.floor(Math.random() * (max - min + 1)) + min;)
1 Like