I’m overwatch streamer, and i want to make a command:how many score left for 4000.

So first, I have tried this: $(eval var x = ‘!score $(query)’; (4000 - x) but, its result was NaN. Because when I typed this command:$(eval var x = ‘!score $(query)’; (x);), the result was “!score”. not number. anyone knows how to set var in command’s number? i want to make it

P.s. Sorry for my poor grammer

This will check whether the input is a number and whether the number is greater than 0 and less than 4000. If so then it will subtract the number from 4000, if not it will return “Error!”

`!addcom -cd=5 !score $(eval a=parseInt(decodeURIComponent(`$(querystring)`));Number.isInteger(a)&&a>=0&&a<=4000?4000-a:`Error!`)`

Then how to edit my score when i win or lose

I set up 2 commands below:

!score which displays the number of games won and the number of games left that you need to win with this response:

```
I have won X games so far and have (4000-X) games left to win!
```

!editscore (mod-only) which takes user input to edit the number of games won and the number of games left to win.

Copy and paste the following command setups into your chat:

```
!addcom -cd=5 !score I have won 0 games so far and have 4000 games left to win!
!addcom !editscore -a=!editcom !score $(eval a=parseInt(decodeURIComponent(`$(querystring)`));Number.isInteger(a)&&a>=0&&a<=4000?`I have won ${a} games so far and have ${4000-a} games left to win!`:` `)
```

Usages:

!score

!editscore [total number of games won]

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