Randomise number 1-20 command

Asked Jun 21, 2024·2 replies·Last activity 2 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

In my twitch chat, I want to add a command !d20 command which randomises a number between 1 to 20 but I’ve been googling and looking around and there’s no clear set commands or any that work to this day.
Anybody have anything like that?

2 replies

sure thing... try this...

js
!addcom !d20 $(eval Math.floor(Math.random()*20)+1)