So I found someone else's script card for attacks and thought it was wonderful. I made a few tweaks for my table and was absolutely ecstatic it seems to take into account damage resist/immunity from things like slashing, fire, etc. But I tried to make it so if I had a silvered weapon (in this case attack 1) it would work against werewolves. What I noticed is, if I put silver the weapon now affects even creatures that require a magical weapon. Turns out any text there (tried gold) also does this. Any help on what I'm setting it up wrong with? I've tried silver, silvered weapon, or silvered. Thanks again and kudos to the !Scriptcard {{
--#sourceToken|@{selected|token_id}
--#targetToken|@{target|token_id}
--/| >>>>> Formatting <<<<<
--#titlecardbackgroundimage|linear-gradient(360deg, rgba(2,0,36,1) 0%, rgba(0,227,208,1) 100%);
--#emoteBackground|#transparent
--#titleCardBackground|#00e3d0
--#titlefontsize|1.75em
--#titlefontlineheight|1.75em
--#titleFontColor|white
--#titlefontface|Shadows Into Light
--#subtitleFontSize|12px
--#subtitleFontFace|Verdana
--#evenRowBackground|#B6AB91
--#evenRowFontColor|#000000
--#oddRowBackground|#CEC7B6
--#oddRowFontColor|#000000
--#Title|Attack
--#whisper|self,gm
--/his will whisper the possible attacks that can be used. It will whisper the buttons to the PC and the DM, that way the DM can see where the Player is at in the process.
--+Choose your weapon.|
[rbutton]Silvered Glaive::knowYourWeapon;1[/rbutton]
[rbutton]Glaive::knowYourWeapon;2[/rbutton]
[rbutton]Javelin::knowYourWeapon;3[/rbutton]
[rbutton]Light Crossbow::knowYourWeapon;4[/rbutton]
[rbutton]Handaxe Melee::knowYourWeapon;5/rbutton][rbutton]Handaxe Thrown::knowYourWeapon;6[/rbutton]
--X|
--:knowYourWeapon|
--#whisper|self,gm
--=Which|[&reentryval]
--?[$Which] -eq 1|>Attack;Glaive;silver slashing;1d10; @{strength_mod} [STR];none;no;10 ft;melee;no;0;yes
--?[$Which] -eq 2|>Attack;Glaive;slashing;1d10; @{strength_mod} [STR];none;no;10 ft;melee;no;0;yes
--?[$Which] -eq 3|>Attack;Javelin;slashing;1d6; @{strength_mod} [STR];Javelin;yes;30/120;thrown;no;0;yes
--?[$Which] -eq 4|>Attack;Light Crossbow;piercing;1d4; @{dexterity_mod} [DEX];Bolts;yes;80/320;ranged;no;0;yes
--?[$Which] -eq 1|>Attack;Handaxe;slashing;1d6; @{strength_mod} [STR];Handaxe;no;5 ft;melee;no;0;yes
--?[$Which] -eq 2|>Attack;Handaxe;slashing;1d6; @{strength_mod} [STR];Handaxe;yes;20/60;thrown;no;0;yes
--/This will pass down the variables to save them for use later.
--:Attack|Variables are 1 Weapon Name;2 damage type;3 damage dice amount;4 damage modifier;5 ammo;6 If it will use ammo;7 range;8 melee, ranged, or thrown;9 magical;10 Magic Level (Sword +2 would just be 2.);Profficient(Yes or No)
--&Weapon|[%1%]
--=Weap|[%1%]
--&DamageType|[%2%]
--&DamageAmount|[%3%]
--&DamageMod|[%4%]
--&ResourceUsed|[%5%]
--&SpendAmmo|[%6%]
--&Range|[%7%]
--&AttackType|[%8%]
--&Magical|[%9%]
--&MagicLvl|[%10%]
--&Prof|[%11%]
--#Title|[&Weapon]
--#leftsub|[&AttackType] Attack
--#rightsub|[&Range]
-->Proficient|Check for the yes or no on &Prof. If yes, will add proficency bonus.
-->MagicalWeapon|Will check if yes or no on &Magical and add &MagicLvl bonus to attack and damage. This example also adds damage from Dragon slayer for example.
--/This section will check if there is a resource needed for an attack. Since a handaxe can be thrown, the PC may not have it in order to attack. First it will see if there is Ammo needed, then it will find where it is, and then it will check if the PC still has some.
--?"[&ResourceUsed]" -eq "none"|noAmmoNeeded
-->GetAndCheckAmmoInformation|[*S:character_id];[&ResourceUsed];Ammoname;Ammo
-->AmmoAvailable|
--:noAmmoNeeded|
--/This will whisper to the DM and Player the possible rolls and allow the DM to inform the player for where they ar at.
--&Bardic|?{Bardic Inspiration [1d6]|No,0|Yes, 1d6}
--+Choose an attack roll type.|[rbutton]Standard::knowYourRoll1;1d20[/rbutton][rbutton]Advantage::knowYourRoll1;2d20kh1[/rbutton][rbutton]Disadvantage::knowYourRoll1;2d20kl1[/rbutton]
--X| DONE
--:knowYourRoll1|
--=AttackRoll|[&reentryval] + [&DamageMod][&PB]+@{selected|global_attack_mod} [GLOBE]+[&Bardic][Bardic]
--#emoteText|@{selected|token_name} attempts to attack @{target|token_name} with their [&Weapon].
-->RollResults|I have a seperate procedure for roll result due to PCs having spells and abilities like Bless and Bardic Inspiration.
--?[$AttackRoll.Base] -eq 20|Crit
--?[$AttackRoll.Base] -eq 1|Fumble
--/This is where you can put roll modifier procedures like bless and bardic inspiration, as these will just add to the roll, they won't affect Crit or Fumble. I will provide examples of those procedures of how I have them at the bottom.
--=AttackRoll|[$AttackRoll]
--?[$AttackRoll.Total] -lt @{target|npc_AC}|Miss
--:Hit|
--#whisper|
-->Vulnerable|
-->RollDamage|
-->PlayEffects|none;none;none;[&Weapon]
--+Hit!|Your attack hit for [$Damage] [&DamageType] damage!
--@alter|_target|@{target|token_id} _bar|1 _amount|-[$Damage]
--?"[&SpendAmmo]" -eq "no"|noAmmoSpent
-->AmmoSpent|
--:noAmmoSpent|
--X|
--:Miss|
--#whisper|
--+Miss|Your attack missed!
--?"[&SpendAmmo]" -eq "no"|noAmmoSpent
-->AmmoSpent|
--:noAmmoSpent|
--X|
--:Fumble|This will roll a fumble table for a "Bad" thing that happened and show it to everyone. You can intrupret how you want to use it. I got mine from <a href="https://saveversus.wordpress.com/2014/09/15/fumble-charts-dd-5th-edition/" rel="nofollow">https://saveversus.wordpress.com/2014/09/15/fumble-charts-dd-5th-edition/</a>
--#whisper|
--=Fumblet|[T#Fumble-Table]
-->PlayEffects|none;none;none;Failure
--+|[img]<a href="https://media3.giphy.com/media/duexIlfr9yYwYE23UA/giphy.gif?cid=ecf05e4735w197ln6hoja74l3ikcd7t0w971w0ljtmjp000n&rid=giphy.gif&ct=g[/img]" rel="nofollow">https://media3.giphy.com/media/duexIlfr9yYwYE23UA/giphy.gif?cid=ecf05e4735w197ln6hoja74l3ikcd7t0w971w0ljtmjp000n&rid=giphy.gif&ct=g[/img]</a>
--+Fumble|The attack went really bad!
--+Bad Stuff| [$Fumblet.tableEntryText]
--=FDamage| [&DamageAmount] + [&DamageMod]
--=FCrit|[&DamageAmount] + [&DamageMod] + [&DamageAmount] [CRIT]
--*Possible Damage| Normal Damage is [$FDamage] and Crit Damage is [$FCrit].
--?"[&SpendAmmo]" -eq "no"|noAmmoSpent
-->AmmoSpent|
--:noAmmoSpent|
--X|
--:Crit|
--#whisper|
-->Vulnerable|
-->RollDamage|crit
-->PlayEffects|none;none;none;[&Weapon]
--+Critical Hit|You deal [$Damage] [%2%] damage CRITICAL HIT!
--@alter|_target|@{target|token_id} _bar|1 _amount|-[$Damage]
--?"[&SpendAmmo]" -eq "no"|noAmmoSpent
-->AmmoSpent|
--:noAmmoSpent|
--X|
--:Vulnerable|
--&vuln|
--?"[*T:npc_vulnerabilities]" -inc "[&DamageType]"|DoubleD
--?"[&Magical]" -inc "yes"|MagVuln
--?"[*T:npc_resistances]" -inc "[&DamageType]"|HalfD
--?"[*T:npc_immunities]" -inc "[&DamageType]"|immune
--<|
--:MagVuln|
--?"[*T:npc_immunities]" -inc "nonmagical"|notImmune
--?"[*T:npc_immunities]" -inc "[&DamageType]"|immune
--:notImmune|
--?"[*T:npc_resistances]" -inc "nonmagical"|notResistant
--?"[*T:npc_resistances]" -inc "[&DamageType]"|HalfD
--:notResistant|
--<|
--:HalfD|
--&vuln| \ 2 [Resistant]
--<|
--:DoubleD|
--&vuln| * 2 [Vulnerable]
--<|
--:immune|
--+|@{target|token_name} is immune to [&DamageType] damage.
--&vuln| * 0 [Immune]
--<|
--:RollDamage|
--?[%1%] -eq crit|CritDamage
--=Damage|[&DamageAmount] + @{selected|global_damage_mod_roll} [GLOBE] +[&DamageMod][&MagWeapDamBonus][&vuln]
--<|
--:CritDamage|
--=Damage|[&DamageAmount] + @{selected|global_damage_mod_roll}[GLOBE] + [&DamageMod] + [&DamageAmount] [CRIT][&MagWeapDamBonus][&vuln]
--<|
--/This is going to find the ammo used on the character sheet and determine how much is available.
--:GetAndCheckAmmoInformation|character_id;resourceName;Ammoname;Ammo
--?"[%2%]" -eq "[*[%1%]:class_resource_name]"|_Lib5E_IsResourceClass
--?"[%2%]" -eq "[*[%1%]:other_resource_name]"|_Lib5E_IsResourceOther
--Rfirst|[%1%];repeating_resource
--:_Lib5E_ResourceLoop|
--?"[*R:resource_left_name]" -eq "[%2%]"|_Lib5E_IsResourceLeft
--?"[*R:resource_right_name]" -eq "[%2%]"|_Lib5E_IsResourceRight
--Rnext|
--?"[*R:resource_left_name]" -ne "NoRepeatingAttributeLoaded"|_Lib5E_ResourceLoop
--&[%3%]|NotFound --&[%4%]|NotFound --$[%4%]|0
--<|
--:_Lib5E_IsResourceClass| --&[%3%]|class_resource_name --&[%4%]|class_resource --=[%4%]|[*[%1%]:class_resource] --<|
--:_Lib5E_IsResourceOther| --&[%3%]|other_resource --&[%4%]|other_resource --=[%4%]|[*[%1%]:other_resource] --<|
--:_Lib5E_IsResourceLeft| --&[%3%]|[*R>resource_left_name] --&[%4%]|[*R>resource_left] --=[%4%]|[*R:resource_left] --<|
--:_Lib5E_IsResourceRight| --&[%3%]|[*R>resource_right_name] --&[%4%]|[*R>resource_right] --=[%4%]|[*R:resource_right] --<|
--<|
--:AmmoAvailable|This will determine if the Ammo needed is available.
--?[$Ammo] -eq 0|NoAmmoLeft
--=Ammo|[$Ammo] - 1
--<|
--:NoAmmoLeft|This will inform the PC that they are out of that ammo they tried to use.
--#whisper|
--+|[*S:character_name] has no [&ResourceUsed] left.
--#emoteText|[*S:character_name] is all out of [&ResourceUsed].
--X|NoSlotsLeftStop
--:AmmoSpent|This will reduce the ammo if used.
--@setattr|_charid [*S:character_id] _[&Ammo]|[$Ammo] _silent
--+|[&ResourceUsed] Left: [$Ammo]
--X|
--:PlayEffects|Parameters are : source effect; target effect; line effect; sound effect
--vtoken|@{selected|token_id} [%1%]
--vtoken|@{target|token_id} [%2%]
--vbetweentokens|@{selected|token_id} @{target|token_id} [%3%]
--@roll20AM|_audio,play,nomenu|[&Weapon]
--<|
--:Profficient|
--&PB|
--?[&Prof] -inc "no"|NotProf
--&PB|+ + @{pb} [PROF]
--:NotProf|
--<|
--:MagicalWeapon|This will check to see if the weapon is magical and add the correct attributes.
--&MagWeapHitBonus|
--&MagWeapDamBonus|
--?"[&Magical]" -inc "Yes"|YesMagic
--<|
--:YesMagic|
--&MagWeapHitBonus|+ + [&MagicLvl] [Magical Weapon]
--&MagWeapDamBonus|+ + [&MagicLvl] [Magical Weapon]
--?"[*T:npc_type]" -inc "dragon"|dragon
--<|
--:dragon|
--&MagWeapDamBonus|+ + 3d6 [Dragon Slayer]
--<|
--:RollResults|This will display the roll results depending on if you have Bardic inspiration or bless activated. This will allow you to mouse over the results and see what happened.
--+Attack Roll|You rolled a [$AttackRoll] to hit.
--<|
}}