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

i need help with scriptcards

    --=smite|?{Smite?|Yes|No}     --?[$smite] -inc "No"|nsmite     --=slevel|?{Level?|1|2|3|4|5|6|7|8|9}     --:[$nsmite]| When i run the full command i still get asked what level whether i say Yes or No to the Smite question, what am i doing wrong?
!scriptcard {{ --#title|Longsword --#titlecardbackground|#a8a5a8 --#titleFontColor|#d6b904 --#leftsub|Melee Attack --#rightsub|5ft Reach --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --#emoteText| VS --#emoteFontColor|#c70000 --&sworddamageType|slashing --&smitedamagetype|radiant --=AttackRoll|1d20 + @{selected|strength_mod} [STR] + @{selected|pb} [PROF] --+Attack|@{selected|token_name} Rolled a [$AttackRoll] to hit --=smite|?{Smite?|Yes|No} --?[$smite] -inc "No"|nsmite --=slevel|?{Level?|1|2|3|4|5|6|7|8|9} --:[$nsmite]| --?[$AttackRoll.Base] -eq 20|Crit --?[$AttackRoll.Base] -eq 1|Fumble --?[$AttackRoll.Total] -eq @{target|npc_ac}|Glancing --?[$AttackRoll.Total] -lt @{target|npc_ac}|Miss --:Hit| --=Damage|1d8+ @{selected|strength_mod} [STR] --+Strike!|@{selected|token_name} dealt [$Damage] [&sworddamageType] damage. --@token-mod|_ids @{target|token_id} _set bar1_value|-[$Damage] --vtoken|@{target|token_id} glow-blood --^Done| --:Miss| --+Miss!| @{selected|token_name} swung and miss. --^Done| --:Fumble| --+Fumble!|@{selected|token_name} missed wildly. --^Done| --:Glancing| --=Damage|1d8+ @{selected|strength_mod} [STR]/2 {FLOOR} --+Glancing|@{selected|token_name} just managed to their target for [$Damage] [&sworddamageType] damage. --@token-mod|_ids @{target|token_id} _set bar1_value|-[$Damage] --vtoken|@{target|token_id} glow-blood --^Done| --:Crit| --=Damage|1d8+ @{selected|strength_mod} [STR] + 1d8 [CRIT] --+Crit!|@{selected|token_name} Hit a Weak spot doing [$Damage] [&sworddamageType] damage. --@token-mod|_ids @{target|token_id} _set bar1_value|-[$Damage] --vtoken|@{target|token_id} nova-blood --:Done| }} Full code for reference (i know that slevel doesn't go anywhere yet i'm trying to learn as i go)
1731063288

Edited 1731063331
Queries are resolved before scripts take effect - if you want a query for level to be only asked on yes, you'll need to nest it inside the first query, as ?{Smite?|Yes,?{Level?|1 |2 |3 |4 |5 |6 |7 |8 |9}|No}
1731064976
Andrew R.
Pro
Sheet Author
The control flow of ScriptCards is irrelevant to Roll Queries like ?{} because the Roll Query is handled by the Roll20 parser before ScriptCards sees the script.&nbsp; Pick a method from this section of the wiki page if you want to avoid Roll Queries:&nbsp; <a href="https://wiki.roll20.net/ScriptCards#Interacting_with_the_GM_and_Players" rel="nofollow">https://wiki.roll20.net/ScriptCards#Interacting_with_the_GM_and_Players</a>
1731093789

Edited 1731094315
thank you for this, so using the button option, &nbsp;&nbsp;&nbsp; --+smite|[button]Add Smite::Smite[/button] results in me being taken to a 404 page on roll20, i'm wanting to make it roll the smite damage, how would i do that? i also tried making a seperate macro for smite (which makes sense as then i can just use a button for any weapon) but when i click the button the command creates it doesn't roll the macro its meant to --+smite|[Add Smite](!‌&amp;‌#‌1‌3‌;‌#Smite) Andrew R. said: The control flow of ScriptCards is irrelevant to Roll Queries like ?{} because the Roll Query is handled by the Roll20 parser before ScriptCards sees the script.&nbsp; Pick a method from this section of the wiki page if you want to avoid Roll Queries:&nbsp; <a href="https://wiki.roll20.net/ScriptCards#Interacting_with_the_GM_and_Players" rel="nofollow">https://wiki.roll20.net/ScriptCards#Interacting_with_the_GM_and_Players</a>
Something in your line is using the wrong symbol, because it doesn't work if I copy paste it, but if I type it out, it brings out the macro I have by the same name. [Add Smite](!&amp;#13;#Smite)
i'm not sure what i should do then, by looking at it, you and i have the exact same macro Tuo said: Something in your line is using the wrong symbol, because it doesn't work if I copy paste it, but if I type it out, it brings out the macro I have by the same name. [Add Smite](!&amp;#13;#Smite)
It looks the same, but try copy pasting mine and seeing if it works. On my end, they produce different results.