Help making a pokeball command

Asked Sep 7, 2022·1 reply·Last activity 3 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.

Hey! So im trying to make a comment with the name " !pball" and have it say (user) has thrown a pokeball at (user 2) and it has a certain percentage catch rate success. If it catches successfully captures a user, it'll give the response that they have been caught. If not, then itll say they failed and (user 2) has got away.

I have no idea how to write something with a random catch rate percentages and 2 different output responses.

Any help would be appreciated!

1 reply

!addcom !pball $(eval
var N = 50;
Math.floor(Math.random()*100)<N?
`Message if @$(touser) is caught`:
`Message if @$(touser) is not caught`)

This should do the trick. Variable N is the catch rate percent. (50=50%, 75=75% etc)