NightDev Community Forums

Unexpected identifier

I want to add a random facts command, but when I type the command it displays error: Unexpected identifier.
!battle A wild $(user) appears & attacks $(touser)! $(user) uses $(eval a=$(urlfetch json;a[Math.floor(Math.random()*a.length)]). $(eval var a=[“It misses…”,“It’s super effective! $(touser) faints”,"It’s not very effective… "]; a[Math.floor(Math.random()*a.length)]:wink:
I could really use some help

Well the first eval should look like this:

$(eval a=`$(urlfetch json PasteBinLink)`.split(`,`);a[Math.floor(Math.random()*a.length)])

Also you should remove the last , in the pastebin as it will cause there to be a null object
And you are using the wrong quotes for the array in the second one use ` instead of “ or ”
I’m only assuming there was an error with both because you didn’t give the actual full response.