Closed mrjaksauce closed 2 years ago
Are you running this without any combat in the Combat Tracker? It will be null, so you won't be able to call endCombat()
I fixed it! Thanks for the input, I needed a little bit more adjusting around what you said.
Thank you again! I was right, it was me :)
This is what I ended up with:
if (token.data.img === sideA && token.inCombat === true)//Has the macro changed the side to sideA? End combat. { await game.combat.endCombat(); } else if (token.data.img === sideB && token.inCombat === false)//Has the macro changed the side to sideB? Turn on combat. { await token.toggleCombat(); game.combat.rollNPC( {rollMode: 'gmroll' } ); //Roll the NPC initiative, hiding it with GM Roll option }
Hello! I get an error when running this macro piece here:
if (img.slice(0,-Math.abs(aName.length)) + (currentSide == 'a' && token.inCombat === true)) await game.combat.endCombat();
Just checking if this is an "advanced macro" issue or, more likely, my coding around this endCombat bit?
Thanks!