Random number generator command

I’m kinda new to moding and don’t really understand the more complicated mods like generating a random number. I want to add a command that says. (@user) is 0-100% smart. and I don’t know how the random number generation works

here u go ^^

$(user) is $(eval Math.floor(Math.random()*101))% smart.
1 Like

Hi, how would you change the code to make it say big or small depending on the number generated?

based on “big” and “small” i’m guessing u wouldn’t want a zero, so the random statement would be a little different… something like this…

$(user) is $(eval let r=Math.floor(Math.random()*100)+1;`${r}% ${r>50?`big`:`small`}!`)

p.s. this will say "<username> is <number>% big!" if the number is above 50 and "<username> is <number>% small!" if 50 and below

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