Hi
I want to make a command with a random number falling in the range from 0 to 100, and if it falls 100, then the bot writes one phrase, and if less, then another. help me please
If/else with Math random
1 reply
Hey @Warm Whale!
$(eval Math.floor(Math.random() * 101) === 100 ? 'NUMBER_EQUALS_100_SENTENCE' : 'DEFAULT_SENTENCE';)
If you need to use apostrophes in your sentence, you'll need to escape them, like this: \' (add a backslash before them).
Please use the search bar before opening a new topic, we covered this topic so many times before.