I'm trying to script a macro that calculates the number of dice rolled based for the damage output, on the macro progression of 5e. It ALMOST works but outputs a zero. Anyone see what is wrong? Thank you! :) !scriptcard {{ --#whisper|gm --/|VARIABLES TO SET --&TargetACAttribute|AC --&DamageAbilityMod|Wisdom_Mod --&AutoApplyDamage|true --&HPBar|1 --&WeaponDamageDieSize|d10 --&PoisonDamageDieSize|0 --/|ScriptCard settings use # and nominmaxhighlight is like the cf<0cs>20 flags used in the original and is coded as --#nominmaxhighlight|1 --#title|Club attack! --#rightsub| --/|Set the source and target tokens --/|These are used by the [*S] and [*T] to reference attributes --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --=Atk|?{Attack|Standard,1d20|Advantage,2d20kh1|Standard,1d20|Disadvantage,2d20kl1} + [*S:[&DamageAbilityMod]] [Ability] + @{selected|pb} [PB] --/|Output the static Atk roll variable with the target's AC value --+Attack|[$Atk] vs AC [*T:[&TargetACAttribute]] --/|If the Atk variable is less than the target's AC jump to the end of the script and exit --?[$Atk] -lt [*T:[&TargetACAttribute]]|Done --/USE THIS LINE BELOW TO CHANGE NUMBER OF MAIN ATTACK DICE ROLLED: --=WeaponDmg|((((@{selected|level} + 1) / 6 + 0.5) ))d[&WeaponDamageDieSize] --?[$Atk.Base] -eq 20|[ --=CritDmg|[&WeaponDamageDieSize] * [&critrolls] --=WeaponDmg|[$WeaponDmg] + [*S:[&DamageAbilityMod]] + [$CritDmg] [CRIT] --]| --/USE THIS LINE BELOW TO CHANGE NUMBER OF SECONDARY ATTACK DICE ROLLED: --=PoisonDice|0 --=PoisonDmg|[$PoisonDice]d[&PoisonDamageDieSize] --=TotalDmg|[$WeaponDmg] + [$PoisonDmg] --:Display| --+|[$WeaponDmg] [&weapondmgtype] [b]necrotic[/b] damage plus [$PoisonDmg] [b]secondary damage[/b] Damage for [b]total of [$TotalDmg] total damage![/b] --?"[&AutoApplyDamage]" -ne "true"|Done --!t:[*T:t-id]|bar[&HPBar]_value:-=[$TotalDmg] --:Done| }}