RNG Number reponses not working

Asked Jan 14, 2024·2 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.

Streamer wanted an "open hand" function, mimicking the chances to pull all 5 pieces of exodia in your opening hand. Basically just a "if this number say this" but with really high numbers. I wasnt sure if i could get it to a 1/658008 chance so we went with a 1/128 chance instead to be an Earthbound reference. I had the code working, then messed around with it and no its not working again.

$(user) has $(eval d=Math.floor(Math.random()*128)+1;s=`;if(d>=1&&<=127){s= bricked.};if(d==128){s=pulled all 5 pieces of the legendary EXODIA. YOU WIN YUGIOH!`};s)

Everytime ive fixed it, Ive either gotten: "unexpected token" "NaN" or just "$user has "

2 replies

that actually looks like my style of code, lol... but yeah, u're just missing a "d" in your first if comparison...
"if(d>=1&&<=127)" should say if(d>=1&&d<=127)

Yeah you helped with with some code before, and I made some edits to change the function :)) tysm