Random number generator but not random

Im looking for a command where i can have it choose a random number from 1-200 but with one certain number being more likely. Any and all help is appreciated.

@nikolaifn You can use the $(eval) variable to pick random numbers: https://docs.nightbot.tv/commands/variables/eval

Adding a command called !rng that picks a number from 1-200 at random and with no bias goes as follows:

!addcom -cd=5 !rng $(eval Math.ceil(Math.random()*200))

But if you want the command to favor one particular number/ranges of numbers you have to be more specific.

1 Like

@RokettoJanpu I was thinking so between a random number of 1-200 but it had 6 favored more. So they were more like 90% of the time to get a 6 and 10% of the time they would get a number between 1-200

Copy and paste this into chat:

!addcom -cd=5 !rng $(eval Math.ceil(Math.random()*10)==10?((Math.ceil(Math.random()*199)+5)%200)+1:6)

1 Like

WORKED GREAT! Thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.