# Random probability change

E.g
Want !random 1 50% 2 30% 3 20%
I am totally unclear in this regard. I want to ask someone for help.
English is not good, I am sorry.

@fairy824912

I am not completely sure what you are looking for. Could you give some more clear examples of what kind of outputs you want from this !random command?

I have three numbers
Each number is a different chance
1 is 50%
2 is 30%
3 is 20%

This command setup will create a command called !random that will output “1” 50% of the time, “2” 30% of the time, and “3” 20% of the time. Just copy and paste this into chat.

``!addcom -cd=5 !random \$(eval a=Math.ceil(Math.random()*10);a<=5?1:(a<=8?2:3))``

thank you very much!
In addition, I want to ask if there are 10 numbers at a time.
1~3 appears 10
E.g
1 1 1 1 2 3 1 2 1 3

This will give 10 numbers at a time:

``!addcom -cd=5 !random \$(eval b=[];for(i=0;i<10;i++){a=Math.ceil(Math.random()*10);b.push(a<=5?1:(a<=8?2:3));}b.join(` `))``

Thank you again!
I will continue to ask questions next time.

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