Hi, I’m from Argentina … I’m new to Nightbot and I want to generate a random number between two ranges of numbers. for example 1-10 and 50-60 …

help me pls

Hi, I’m from Argentina … I’m new to Nightbot and I want to generate a random number between two ranges of numbers. for example 1-10 and 50-60 …

help me pls

Heya, try this…

$(eval const r= [’$(eval Math.floor((Math.random() * 10) + 1))’, ‘$(eval Math.floor((Math.random() * 10) + 51))’]; r[Math.floor(Math.random() * r.length)]

Well if you want any other use this

Math.floor((Math.random() * (*max_num* - *min_num*) + *min_num* + 1)

I hope it will work… And please ignore my logic

1 Like

Thanks for your answer!! but the command doesn’t work ): , Nightbot says “Invalid or unexpected token” in chat

Ahh you know what… That was not my fault… Lemme explain… If you type [ ; ) ] without space it will turn into [] this emote… *See at the last*

Copy this… I hope this will work

`$(eval const r= ['$(eval Math.floor((Math.random() * 10) + 1))', '$(eval Math.floor((Math.random() * (10)) + 51))']; r[Math.floor(Math.random() * r.length)]; )`

1 Like

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