2 outputs in eval

Hi, I’m trying to make a command with a 2 randomized numbers. First number is in range 1-10, second is depends on first (if a=1 then b=0-100, if a=2 then b=101-200 etc).
I’m new to js and don’t know how to properly show output, nightbot only shows number b.
Output should be like: LVL is “a”, EXP is “b”.

My code:
$(eval
a=Math.floor(Math.random() * 2+1);
a == 1 ?
b=(Math.floor(Math.random() * (100 - 1) ) + 1):
a == 2 ?
b=(Math.floor(Math.random() * (200 - 100) ) + 100):
document.write())

$(eval a=Math.floor(Math.random()*10+1);b=Math.floor(Math.random()*101)+(a*100-100);`Lvl is ${a}, Exp is ${b}`)
3 Likes

Thanks, your code helped a lot :slight_smile:

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