Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
We’re experiencing intermittent loading issues due to an external service provider. Please refresh if needed.
Create a free account

ScriptCard Damage Roll

I took the damage script Craven created and I am trying to modify it to my needs but I am having an issue pulling @{target|token_id} into --& or --# to set [$Target] and [$TargetAC] Here is what I have: !scriptcard  {{  --:USER INPUT|    --&RollString|?{Attack Type?|Normal,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1}+[[@{selected|dexterity_mod}]] + [[@{selected|pb}]] + 3]]   --&DamDice|?{Damage Dice?|1d4}   --#Target|@{target|token_name}  (I also tried using --&)   --#TargetAC|@{target|npc_ac} --:TITLE CARD DISPLAY|   --#title|Attack against [$Target].   --#leftsub|[&RollString]   --#rightsub|Nice and easy! --:LOOP THROUGH ATTACKS       -->MakeAttack| call function --:DISPLAY TOTAL DAMAGE|   --+Total|Total damage is [$DamageTotal]    --X|Exit macro --:PROCEDURES|   --:MakeAttack|       --=ThisAttack|[&RollString]       --?[$ThisAttack.Base] -eq 20|Crit       --?[$ThisAttack] -ge [$TargetAC]|HIT       --?[$ThisAttack] -lt [$TargetAC]|HIT      --:AttackDone|   --<|      --:Hit|       --=ThisDamage|[&DamDice][BASE]+1d4+[[@{selected|dexterity_mod}]] + 3       --=DamageTotal|[$DamageTotal] + [$ThisDamage.Total]       --+Attack[$DisplayCount.Total]|[$ThisAttack] [b]Hits[/b] for [$ThisDamage] dam       --^AttackDone|   --<|   --:Crit|       --=ThisDamage|[&DamDice][BASE]+[[@{selected|dexterity_mod}]] + 3 [MOD] + 4 [CRIT]       --=DamageTotal|[$DamageTotal] + [$ThisDamage.Total]       --+Attack[$DisplayCount.Total]|[$ThisAttack] [b][#009900]Crits[/#][/b] for [$ThisDamage] dam       --^AttackDone|        --<| }} Thanks for any assistance.
1670451571
GiGs
Pro
Sheet Author
API Scripter
There's a dedicated scriptcards folder where yiu might get help with the syntax.
Thanks I just figured it out. User error of course. Thing are case sensitive after all....ugh. :)
1670455995
GiGs
Pro
Sheet Author
API Scripter
Hehe, yes that can be a pain. Generally anything using scripts (or javascript) is case sensitive, and things based entirely in html is not.