I want to add text to a field. Each % required

Asked May 18, 2024·4 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.

@$(touser) $(eval r=(a,b)=> Math.floor(Math.random()*(b-a+1))+a; p=r(1,100); o=r(0,10);if(p>10){o=r(11,94)}if(p>20){o=r(95,100)}if(p>95){o=r(100,95)} o;)

I want to add text to a field. Each % required (10% = Bad 11-94% = Good 95-100% =Awesome)
I newbie in read code please teach me Thx

4 replies

this code is doing much more than u're asking, if i understand u correctly... but try this...

js
@$(touser) $(eval r=(a,b)=> Math.floor(Math.random()*(b-a+1))+a; p=r(1,100); o=`Bad`;if(p>10){o=`Good`};if(p>94){o=`Awesome`};o)

I want to show the % number as well and want the chance to be correct to be 95-100 high, but 10 has a lower chance but there is still a message. Example (Name) Good weather 98% Awesome.

lower chance to get 10 and under, ok, how about like this...

js
@$(touser) $(eval r=(a,b)=> Math.floor(Math.random()*(b-a+1))+a; p=r(1,100); o=`${p}% Bad`;if(p>10){o=`${r(11,94)}% Good`};if(p>79){o=`${r(95,100)}% Awesome`};o)

where it has a 10% chance to get 10 and under, and a 20% chance to get 95 and up

That's exactly I want Thank you So Much.