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
This post has been closed. You can still view previous posts, but you can't post any new replies.

Advice (help) request with a script that is used to implement Finesse Weapon for 5E

Hello everyone! Based on a lot of reading and experiments, I have pieced together a script that asks the user to choose between strength and dexterity for use in the attack roll.  After the choice, it also adds the proficiency bonus to the attack roll.  Towards the bottom of the script, damage is rolled based on the choice between strength or dexterity, but for this roll proficiency is not added (within the script).  However, when the script is used, proficiency IS added to the damage roll and I do not understand why?  Any advice??  Thank you!!! @{selected|token_name} attacks with his DAGGER! Total roll: [[1d20 ?{Finesse Weapon:|Strength, + @{selected|strength_mod} [Strength] + @{selected|PB} [Proficiency]|Dexterity, + @{selected|dexterity_mod} [Dexterity] + @{selected|PB} [Proficiency]}]] / [[1d20 ?{Finesse Weapon:|Strength, + @{selected|strength_mod} [Strength] + @{selected|PB} [Proficiency]|Dexterity, + @{selected|dexterity_mod} [Dexterity] + @{selected|PB} [Proficiency]}]] If attack was successful, he damages his enemy for [[1d4 ?{Finesse Weapon:|Strength, + @{selected|strength_mod} [Strength]|Dexterity, + @{selected|dexterity_mod} [Dexterity]}]] points of PIERCING damage!
1469762053

Edited 1508961588
When you Submit a Roll Query (i.e. assign it a value), every following Roll Query that shares the same name is parsed to the value of the first. e.g. If you Submit the default value of ?{One|1}, all future Roll Queries named 'One' will be parsed to '1'. [[ ?{One|1|1} + ?{One} + ?{One|2d6} ]] equals three To add, I generally recommend that elements common to every drop-down field of a Roll Query be factored out. e.g. ?{Q|A, [[1d20 + 1]]|B, [[1d20 + 2]]|C, [[1d20 + 3]]} → [[ 1d20 + ?{Q|A, 0|B, 1|C, 2} + 1 ]] All said, try this out: @{selected|token_name} attacks with his DAGGER! Total roll: [[ 1d20 + ?{Finesse Weapon|Strength, @{selected|strength_mod} [Strength]|Dexterity, @{selected|dexterity_mod} [Dexterity]} + @{selected|PB} [Proficiency] ]] / [[ 1d20 + ?{Finesse Weapon} + @{selected|PB} [Proficiency] ]] If attack was successful, he damages his enemy for [[ 1d4 + ?{Finesse Weapon} ]] points of PIERCING damage!
Thank you Silvyre! Your changes work great, and I learned something too!! LOL