Command Including Eval Not Working HELP PLEASE


I am currently trying to make a new command for my channel but I am having trouble with the outcome.

My command: !addcom !chase $(user) Was Running Away From 12 And… $(eval const responses = [‘Crashed’, ‘Got Away Safely’, ‘Got Wasted’, ‘Got Busted’, ‘Was Locked Up For A Year’, ‘Got Out The Car And Started Shooting’, ‘Surrendered’, ‘Called In Back Up’]; responses[Math.floor(Math.random() * responses.length)];

Outcome: JayWillPlay_ Was Running Away From 12 And… Right-hand side of ‘instanceof’ is not an object

Can someone please explain to me why this happens and how to fix it?

Invalid code causes instanceof errors, in this case probably the quotation characters you used. Fix:

!addcom -cd=5 !chase $(user) Was Running Away From 12 And... $(eval a=[`Crashed`,`Got Away Safely`,`Got Wasted`,`Got Busted`,`Was Locked Up For A Year`,`Got Out The Car And Started Shooting`,`Surrendered`,`Called In Back Up`];a[Math.floor(Math.random()*a.length)])

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