How would it work (randomizer) from 1-20

Since I have no clue of codeing…
Can someone make such an command?
Like i’ve said, just one that goes from 1-20… also can you make a name for every number?
Every number should have the same chance to win if you want so. (5% each)

Would be great if someone could help

Are you looking to add a command that returns a response or a number when it’s called or both?

Yeah, basically that I get a random number between 1 and 20

And I have no i dont know if you can name every number something…
(thats just a side thing which would make it better)

Hey @franklstein78!

For a random number between 1 and 20 inclusive use:

$(eval Math.floor(Math.random()*20)+1)

If you want to name every 20 outputs, it’d be easier to create an array and then pick something at random out of it:

$(eval a=[`ARRAY_ITEM_1`,`ARRAY_ITEM_2`,`ARRAY_ITEM_3`, ... ,`ARRAY_ITEM_20`];a[Math.floor(Math.random()*a.length)])
1 Like

First of all, thanks a lot!
It worked just fine, It took a while to type as you can imagine…
But still thanks for your great Help!

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