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

scriptcard macro help

1740644349
Nylo
Pro
Marketplace Creator
sorry if im asking alot these days but setting up a custom game. !script {{ --#title|🎲 Attack Roll 🎲 --#whisper|self --= Roll |1d4 --#emoteText| Rolling a d4 for attack... --?[$Roll] -eq 1 |[ --+ Result | You rolled a ** 1 ( Miss !)** ❌ --]|?[$Roll] -eq 4 |[ --+ Result | You rolled a ** 4 ( Crit !)** 🎯 --]|[ --+ Result | You rolled a **[$Roll]**. --] }} this one work on a d4 when we miss but not when we hit. further more i would like the roll to query how many ydxkh1 if result is highest show the crit if result is a 1 show miss (and ofcourse still the dice) if it is possible on a crit pop a button that roll same dice as chosen but exploding etc 1d4! if that is not possible then just a query of what dice i would like to roll. if its not possible to pop a button roll in chat its ok to i will roll it manually
1740644490
Nylo
Pro
Marketplace Creator
would like the top yellow to disappear to if this kind of thing is only possible with another api like powercards i can install anything
1740645925
Nylo
Pro
Marketplace Creator
yes and the whisper is only me who sees it because i want everyone to see it
So if I'm understanding this correctly - you want 1. To select X and Y 2. Roll XdYkh1 3. If result is 1, show miss and the roll 4. If the result is Y, show crit, the roll and a button that will roll 1dY! 5. If neither of the above, show roll Do I have all of this right? If so, this should all be doable without scripts, and I can help you.
1740647375
Nylo
Pro
Marketplace Creator
yes i believe you do if possible i  would like it to query kh1 or kl1 too but if not possible i will just duplicate it for advantage / disadvantage
1740647526
Nylo
Pro
Marketplace Creator
and thnks a lot for all your time
&{template:default} {{name=Attack Roll (?{advantage/disadvantage|none,1d?{die size|4}|advantage,?{die count|2}d?{die size|4}kh1|disadvantage,?{die count|2}d?{die size|4}kl1})[ ](#" hidden null=) }} {{[-1.5]=[ ](#" hidden null=) }} {{[1]=Miss[ ](#" hidden null=) }} {{[0.5]=[ ](#" hidden null=) }} {{[?{die size|4}]=[Crit!](!/
 &{template:default} {{name=Critical}} {{Roll=[[1d?{die size}!]]}})[ ](#" hidden null=) }} {{[-0.5]=[ ](#) }} {{[[[ {0,[[?{advantage/disadvantage}]]}>?{die size}f=1-0.5]]]=[ ](#) }} {{Roll=$[[0.computed]] }} Alright, this should do it - it's a little complicated, but if there's any part of it you'd like to learn more about, I'd be happy to explain!
1740652441
Nylo
Pro
Marketplace Creator
Thanks i will look at it tonight when i come home
1740672086
Nylo
Pro
Marketplace Creator
its very good is there a way i can wrap it inside my scriptcard so iit outputs like my other rolls
C1 said: its very good is there a way i can wrap it inside my scriptcard so iit outputs like my other rolls Probably not, since it relies on the behavior of the template, but I know very little about scriptcards. But someone else can probably tell you how to do the same with scriptcards.
1740673821
Nylo
Pro
Marketplace Creator
i will just use it as it is just liked the better looks of scriptcards or powercards 
1740673847
Nylo
Pro
Marketplace Creator
because it do all i need to do
1740703265
Andrew R.
Pro
Sheet Author
Ask in the ScriptCards thread in the Mods forum for help with ScriptCards. <a href="https://app.roll20.net/forum/permalink/11175456/" rel="nofollow">https://app.roll20.net/forum/permalink/11175456/</a>
1741815217
Nylo
Pro
Marketplace Creator
Tuo said: &amp;{template:default} {{name=Attack Roll (?{advantage/disadvantage|none,1d?{die size&amp;vert;4&amp;rbrace;|advantage,?{die count&amp;vert;2&amp;rbrace;d?{die size&amp;vert;4&amp;rbrace;kh1|disadvantage,?{die count&amp;vert;2&amp;rbrace;d?{die size&amp;vert;4&amp;rbrace;kl1})[ ](#" hidden null=) }} {{[-1.5]=[ ](#" hidden null=) }} {{[1]=Miss[ ](#" hidden null=) }} {{[0.5]=[ ](#" hidden null=) }} {{[?{die size|4}]=[Crit!](!/&amp;NewLine; &amp;amp;{template:default} &amp;lbrace;{name=Critical}&amp;rbrace; &amp;lbrace;{Roll=&amp;lbrack;&amp;lbrack;1d?{die size}!&amp;rbrack;&amp;rbrack;}&amp;rbrace;)[ ](#" hidden null=) }} {{[-0.5]=[ ](#) }} {{[[[ {0,[[?{advantage/disadvantage}]]}&gt;?{die size}f=1-0.5]]]=[ ](#) }} {{Roll=$[[0.computed]] }} thanks for the help, i do have situations where i be rolling etc 3d4dl1 and there i only want the crit button to show if the first kept roll is the max so the crit button should only come if the 3 were a 4
There isn't really a way to distinguish individual rolls in a multi-dice roll like that (at least not without scripts, not sure how doable it is with them), and the macro I wrote can only determine max roll of a single (kept) die. It could be modified to account for multiple dice (currently if you roll multiple max results it doesn't display correctly, as it was set up for a single die), but there would still be no way to pick out only the first kept roll. You'd have to make that roll separately from the rest of the dice, and the drop lowest part of it makes that complicated.