Two response percentage command

Asked Apr 27, 2020·2 replies·Last activity 6 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.

Hello I'm trying to make a command that 4% of the time will say one thing and 96% of the time say something else?

I found a post on here and got this command from it:

!addcom !question $(eval Math.floor(Math.random()*100)==99?'Yes':'No')

I tried using this and changing somethings but I only ever get one answer.I play a game called Dead By Daylight and jumping off thehook (Kobe-ing) has a 4% chance so I wanted it to be like that. Is this possible?

I tried this and tried other percentages too like 50% to be sure that it worked for both responses:

!addcom !Kobe $(eval Math.floor(Math.random()*100)==96?'$(user) Kobied!':'$(user) did not Kobe')

2 replies

Here's a fix.

!addcom -cd=5 !Kobe $(eval Math.ceil(Math.random()*100)>96?`$(user) Kobied!`:`$(user) did not Kobe`)