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 .
×
Create a free account

Conditions looks are ignored, what's wrong in my code?

I'm using ScriptCards v3 in Roll20 to handle an attack with selectable damage type ("normal" or "crit"). I'm using rbutton to let the player choose between the two, and I'm correctly capturing the value in &amp;reentryval . However, even though the choice appears correctly (confirmed by debug output), the conditional logic using&nbsp;doesn't seem to work. Only the last condition seems to apply, or the danno variable ends up being 0 regardless of the selected option. It's as if the conditions are ignored or not processed correctly during evaluation. I've verified that the modifiers are being loaded properly. How can I ensure that the correct damage formula is used based on the selected button? !script {{ --#sourceToken|@{selected|token_id} --#leftsub|[*S:character_name] --#rightsub|Attacco con triplo vantaggio --#title|TRIPLO KAIOKEN --&amp;mod|[*S:dexterity_mod] --&amp;proficency|[*S:pb] --=AttackRoll|3d20kh1 + [&amp;mod][DEX] + [&amp;proficency][PROF] --+Tiro per colpire|[$AttackRoll] [img]'<a href="https://i.pinimg.com/474x/fb/71/0c/fb710ce1b3a06092370cb3e2f72081d8.jpg" rel="nofollow">https://i.pinimg.com/474x/fb/71/0c/fb710ce1b3a06092370cb3e2f72081d8.jpg</a>' [/img] --+|[t width=100% style='text-align:center;'] [tr][td][rbutton]Tira Danni::Danno;normale[/rbutton][/td][/tr] [tr][td][rbutton]💥CRITICO!::Danno;crit[/rbutton][/td][/tr] [/t] --X| --:Danno| --&amp;arma|[&amp;reentryval] --?|[&amp;arma] -eq normale;--=danno|1d8+1 + [&amp;mod][DEX] + 3d6[SNEAKY] --?|[&amp;arma] -eq crit;--=danno|31[💥CRIT💥]+1d8+1 + [&amp;mod][DEX] + 3d6[SNEAKY] --+|[t width=100% style='text-align:center;'] [tr][td]💥💥💥 Danno inflitto: [$danno] 💥💥💥[/td][/tr] [/t] --X| }}
Just for info, i solve in this way !script {{ --#sourceToken|@{selected|token_id} --#leftsub|[*S:character_name] --#rightsub|Attacco con triplo vantaggio --#title|TRIPLO KAIOKEN --&amp;mod|[*S:dexterity_mod] --&amp;proficency|[*S:pb] --=AttackRoll|3d20kh1 + [&amp;mod][DEX] + [&amp;proficency][PROF] --+Tiro per colpire|[$AttackRoll] [img]'<a href="https://i.pinimg.com/474x/fb/71/0c/fb710ce1b3a06092370cb3e2f72081d8.jpg" rel="nofollow">https://i.pinimg.com/474x/fb/71/0c/fb710ce1b3a06092370cb3e2f72081d8.jpg</a>' [/img] --+|[t width=100% style='text-align:center;'] [tr][td][rbutton]Tira Danni::Danno;normale[/rbutton][/td][/tr] [tr][td][rbutton]💥CRITICO!::Danno;crit[/rbutton][/td][/tr] [/t] --X| --:Danno| --&amp;arma|[&amp;reentryval] --+|[&amp;arma] --?"[&amp;arma]" -eq "normale"| [ --=danno|1d8+1 + [&amp;mod][DEX] + 3d6[SNEAKY] --]|[ --=danno|31[💥CRIT💥]+1d8+1 + [&amp;mod][DEX] + 3d6[SNEAKY] --]| --+|[t width=100% style='text-align:center;'] [tr][td]💥💥💥 Danno inflitto: [$danno] 💥💥💥[/td][/tr] [/t] --X| }}