How can i have each response have a chance of appearing in a single command?

I want to be able to have nightbot give a random response out of 5 options, with each option having a specifc chance to appear when they use a specific command. I want five responses, starting with one response at 45% chance, next being 25%, then 15% then 10% then 5%. I hope this makes sense.

that sounds fun… can be done like this…

$(eval x=Math.floor(Math.random()*100);x<55?(x<30?(x<15?(x<5?`RESPONSE_FIVE`:`RESPONSE_FOUR`):`RESPONSE_THREE`):`RESPONSE_TWO`):`RESPONSE_ONE`)

follows the same pattern u said…
RESPONSE_ONE = 45% chance
RESPONSE_TWO = 25% chance
RESPONSE_THREE = 15% chance
RESPONSE_FOUR = 10% chance
RESPONSE_FIVE = 5% chance

2 Likes

Omggg you are a life saver! Gonna test this right now!

just be careful that when u replace the words that u don’t get rid of the back ticks ( ` ) on either end :wink:

1 Like

I will take care with that!

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