i have reworked the fireball script by Kurt to fit my pathfinder 1st Edition game. Now I ran into the problem, that I want to check the repeating feats for a certain feat and the way I have tried doesn't work. The part that isn't working can be found below (bold and bigger text) . I think the @{target|token_id} is the problem. Maybe someone can help me with that. !script {{ --/Description|Deals fireball damage to all tokens that represent creations in a 20' radius around target token --/|Set up the card appearance --#SourceToken|@{selected|token_id} --Lsettings|Samuel --#title|@{selected|character_name} casts Fireball! --#leftsub|Save DC [*S:caster1_dc_level_3] --/|Get a spell slot level from the caster. --=SpellLevel|[*S:caster1_level] --#rightsub|Slot Level: [$SpellLevel] --/|Calculate damage based on spell slot. Fireball is 8d6 for 3rd level, so 5+SpellLevel d6 total. --?[$SpellLevel.total] -le 10|=DamageDice;[$SpellLevel.Total]|=DamageDice;10 --=Damage|[$DamageDice.Total]d6 --/|Since we want to be able to hover over a roll and see the dice details, output the rolled damage at the --/|top of the card. If all critters make their save, the half damage roll won't contain the details. --+|[c][b]Damage Roll: [/b][$Damage][/c] --+|&nbsp; --/|Get all tokens on the page into the "alltokens" array --~|array;pagetokens;alltokens;@{target|token_id} --/|Create the "inRange" array. It will have a blank item in it to begin with, which we will remove later. --~|array;define;inRange; --/|Loop through all of the tokens in "alltokens" to check their distance --~tokenid|array;getfirst;alltokens --?[&tokenid] -eq ArrayError|endOutput --:loopCheck| --/|Skip targets that are not on the token layer or that don't represent creatures --?[*[&tokenid]:t-layer] -ne objects|continue --?"[*[&tokenid]:t-represents]" -ninc "-"|continue --/|Check the distance between the target token and the current array token. 20 feet is 4 units --~dist|distance;@{target|token_id};[&tokenid] --?[$dist] -gt 4|continue --/|If we didn't skip over this part, the token is within 20 feet, so add it to the inRange array --~|array;add;inRange;[&tokenid] --:continue| --~tokenid|array;getnext;alltokens --?[&tokenid] -ne ArrayError|loopCheck --/|Remove the dummy first item in the inRange array --~|array;removeat;inRange;0 --/|Loop through the inRange tokens and roll saves for each one and apply damage --~tokenid|array;getfirst;inRange --?[&tokenid] -eq ArrayError|endOutput --:loopDisplay| -->MakeSavingThrow|[&tokenid];reflex;[*S:caster1_dc_level_3];[$Damage.Total];fire;thisTokenDamage;saveResult;reflex --+[*[&tokenid]:t-name]:|Save [$savingThrow] [r][$thisTokenDamage] fire damage[/r] --/|Put a burn-fire visual effect on impacted tokens --vtoken|[&tokenid] burn-fire --/|Get the next token and continue the loop until we run out. --~tokenid|array;getnext;inRange --?[&tokenid] -ne ArrayError|loopDisplay --/|Add some extra visual effects - a nova-fire at the target, and a beam-fire from source to target --vtoken|@{target|token_id} nova-fire --vbetweentokens|@{selected|token_id} @{target|token_id} beam-fire --:endOutput| --X| --/|Subroutine to make saving throws and calculate damage amounts --:MakeSavingThrow|tokenid;savetype;dc;damage;damagetype;damagevariable;saveresultvariable;shortabilityname --Rfind|@{target|token_id};Entrinnen;repeating_feats;name --?"[*R:name]" -eq "NoRepeatingAttributeLoaded"|&Entrinnen;no|&Entrinnen;yes --+Entrinnen?|[&Entrinnen] < --=savingThrow|1d20 + [*[%1%]:[%2%]] --&dmgmult| --?[$savingThrow] -ge [%3%]|>set_string;dmgmult; \ 2 --?[$savingThrow] -lt [%3%]|>set_string;[%7%];fail --?[$savingThrow] -ge [%3%]|>set_string;[%7%];success --?"[*[%1%]:resist]" -inc "[%5%]" -and [$savingThrow] -lt [%3%]|>set_string;dmgmult; -[*[%1%]:resistfire] --?"[*[%1%]:resist]" -inc "[%5%]" -and [$savingThrow] -ge [%3%]|>set_string;dmgmult; -[*[%1%]:resistfire] --?"[*[%1%]:weaknesses]" -inc "[%5%]" -and [$savingThrow] -ge [%3%]|>set_string;dmgmult; * 1.5 --?"[*[%1%]:weaknesses]" -inc "[%5%]" -and [$savingThrow] -lt [%3%]|>set_string;dmgmult; * 1.5 --?"[&Entrinnen]" -inc "yes" -and [$savingThrow] -ge [%3%]|>set_string;dmgmult; * 0 --?"[*[%1%]:immune]" -inc "[%5%]"|>set_string;dmgmult; * 0 --=[%6%]|[%4%] [&dmgmult] --?[$[%6%]] -lt 0|=[%6%];0 --<| --:set_string|mod_variable;value --&[%1%]|[%2%] --<| --/|Subroutine to apply damage with TokenMod. Could be replaced with alterbars or chatsetattr --:ApplyDamageTokenmod|Parameters are [&tokenid];1;[$thisTokenDamage] --@token-mod|_ignore-selected _ids [%1%] _set bar[%2%]_value|[%3%] --<| }}