Help me with complex nightbot twitch command

so i have a complex command that i cant figure out how to fix it, the command is

!commands add !attack $(user) has dealt $(customapi$(1)&end=$(2)) damage to $(touser) -cd=5 $(eval Math.round(Math.random())==0?, $(user) won the fight,:`bad luck, $(touser) won the fight)

but i the thing i want to change is if that the number is >5 then i want it to say $(user) won the fight but if its <5 i want it to say bad luck, $(touser) won the fight)

if you have any solution for this please comment it below

If the damage is equal or greater than 5, the user wins, otherwise the touser wins.

!addcom -cd=5 !attack $(eval a=Math.ceil(Math.random()*10);`$(user) has dealt ${a} damage to $(touser). `+(a>=5?`$(user) won the fight!`:`Bad luck, $(touser) won the fight.`))

thank you, Rokettojanpu

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