!slap command with variable outcome

I already have a !slap command in place where I can get either a user to “slap” or in my case “take aim” at a random or named user, it will then generate my 1st $(eval) which are a list of weapons, I then want it to give me another outcome on a 2nd $(eval) like “and killed them” or “hit the barn door”

The code I have so far is:

$(eval a=[Shot Gun,M4A1,Throwing Knife,Semtex,.50 Cal,Noob Tube];$(user) aimed at ${$(query)||$(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel))} with a +a[Math.floor(Math.random()*a.length)])!

any help welcomed

You could do it all in one eval just set another array of strings like this:

$(eval 
a=[`Shot Gun`,`M4A1`,`Throwing Knife`,`Semtex`,`.50 Cal`,`Noob Tube`];
//**
b=[`and killed them`,`and hit the barn door`,`etc.`];
//**
`$(user) aimed at 
${`$(query)`?`$(query)`:`$(urlfetch https://2g.be/twitch/randomviewer.php?channel=$(channel))`} 
with a 
${a[Math.floor(Math.random()*a.length)]} 
${b[Math.floor(Math.random()*b.length)]}`)!

The stars aren’t necessary they just indicate where to look

2 Likes

Cheers! Gona give this a try

1 Like

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