 
 That's great Andrea, and thanks Colin! I had tried using a &select construction but must have had some malformed syntax.   Andrea,  you could try replacing the @{selected...} with an @{target...}.  If you are targeting multiple targets, you'd probably need to build the command string dynamically in scriptcards first.  EDIT - This seems to work for me. I moved the Spawn line to after the MissileLoop and only called it once with this line   --@forselected+|Spawn _name|Surtur _offset|0,-1 _qty|1 {^&select [&SpawnTargets]}   ...and populated the SpawnTargets variable in your FireMissile subroutine with this line       --&SpawnTargets|+ [&ThisTarget]   Resulting scriptcard:  !script {{
    --/|Script Name : 5E Magic Missile
    --/|Version     : 2.0
    --/|Requires SC : 1.4.0+, alterbars or token-mod to apply damage (Optional)
    --/|Author      : Kurt Jaegers
  
    --/|Description : Handles the D&D 5E spell Magic Missile, with the ability to select a dynamic
    --/|              number of targets. 
    --/|
    --/|              You can optionally have damage applied to impacted tokens. The script defaults to using
    --/|              TokenMod to update Bar 3. These can be changed by altering the settings below.
    --/|              If you use one die roll for Magic Missile, update the damageMode variable below.
    
    --/|Set this to either "token-mod", "alterbars", or anything else to not apply damage
    --&damageApplyScript|token-mod
  
    --/|Set this to the bar number you use to track hit points
    --&hitPointsBar|1
  
    --/|If damageMode is 1, a separate die will be rolled for each missile. Set this variable to 0 to, 
    --/|only have a single damage die roll applied to each missile.
    --&damageMode|1
  
    --/|Magic Missile by the book does Force damage.
    --&damageType|elettrico
  
    --/|===================== There are no customization options below this line =====================
  
    --#title|Meduse
    --#sourceToken|@{selected|token_id}
    -->GetAndCheckAp
    --=SlotLevel|40
    --=SkillLevel|[*S:ms_4_lv]
    --=MissileCount|[$SkillLevel] + 1
    --=OneMissileDamage|[$SkillDmg]
    -->BuildAndAskTargets|[$MissileCount.Total]
    --=DisplayCount|1
    --=MissileDamage|0
    --#leftsub|Ap [$SlotLevel]
    --#rightsub|Ranged Attack
    --#emoteText|@{selected|character_name} usa [$SlotLevel.Total] AP per lanciare [$MissileCount.Total] meduse elettrificate!
  
    --:GetAndCheckAp|
        --=ApCost|30
        --=ApDisp|[*S:Ap]
        --?[$ApCost.Total] -gt [$ApDisp.Total]|NoSlotsLeft
    --<|
    --/|Determine damage subroutine. Start by assuming we aren't going to apply damage
    --&damageRoutine|DontApplyDamage
    --?[&damageApplyScript] -eq "token-mod"|&damageRoutine;ApplyDamageTokenmod
    --?[&damageApplyScript] -eq "alterbars"|&damageRoutine;ApplyDamageAlterbars
  
    --:MissileLoop|
        -->FireMissile|[$DisplayCount.Total]
        --=DisplayCount|[$DisplayCount] + 1
        --?[$DisplayCount] -le [$MissileCount]|MissileLoop
     --@forselected+|Spawn _name|Surtur _offset|0,-1 _qty|1 {^&select [&SpawnTargets]} 
    -->UsaAp|
    --#rightsub| Paralizza + Veleno 
    --X|
  
    --:FireMissile|
        --&ThisTarget|[&target[%1%]]
         --&SpawnTargets|+ [&ThisTarget], 
        --=SkillAtk|( 1d4 + 1 + [*S:totale_intelligenza] ) * 10
        --=EnemyDef|( 10 + { 0 , [*[&ThisTarget]:t-bar3_max] } kh1)
        --=SkillDmg|( [$SkillAtk] / [$EnemyDef] ) {FLOOR}
        --?[&damageMode] -eq 1|=ThisMissile;[$SkillDmg]|=ThisMissile;[$OneMissileDamage]
        --=MissileDamage|[$MissileDamage] + [$ThisMissile]
        --+Medusa|[$DisplayCount.Total]: [$ThisMissile] danni base.
        -->PlayEffects|@{selected|token_id};[&ThisTarget];none;bomb-holy;none;none
        --=ResultantDamage|[$ThisMissile.Raw]
        --?"[*[&ThisTarget]:npc_immunities]" -inc "[&damageType]"|Immune
        --?"[*[&ThisTarget]:npc_resistances]" -inc "[&damageType]"|Resistant
        --?"[*[&ThisTarget]:npc_vulnerabilities]" -inc "[&damageType]"|Vulnerable
        --^DoneResist|
        --:Immune|
        --=ResultantDamage|0
        --+La Medusa|[$DisplayCount.Total] colpisce con i suoi tentacoli [*[&ThisTarget]:t-name], ma questo sembra ignorarla!
        --^DoneResist|
        --:Resistant|
        --=ResultantDamage|[$ThisMissile] \ 2
        --+Medusa|[$DisplayCount.Total] colpisce [*[&ThisTarget]:t-name] per [$ResultantDamage] danni [b]elettrici[/b]
        --^DoneResist|
        --:Vulnerable|
        --=ResultantDamage|[$ThisMissile] * 2
        --+Medusa|[$DisplayCount.Total] colpisce [*[&ThisTarget]:t-name] per [$ResultantDamage] danni [b]elettrici[/b]
        --^DoneResist|
  
        --:DoneResist|
        -->[&damageRoutine]|[&ThisTarget];[&hitPointsBar];[$ResultantDamage.Raw]
    --<|
    
    --:BuildAndAskTargets|
        --&TargetString|
        --=targetCount|1
        --:TargetLoop|
            --&TargetString|+t;target[$targetCount.Raw];Missile [$targetCount.Raw] Target
            --=targetCount|[$targetCount.Raw] + 1
            --?[$targetCount] -le [%1%]|>AddSeparator
            --?[$targetCount] -le [%1%]|TargetLoop
        --iPlease click the button below to select magic missile targets. The same target can be selected multiple times;Select [%1%] Targets|[&TargetString]
        --/|
    --<|
  
    --:AddSeparator|
        --&TargetString|+||
    --<|
    --:NoSlotsLeft|
    --+|[*S:character_name] non ha abbastanza AP. [$ApDisp.Total] AP disponibili.
    --X|
    
    --/|===================== Subroutines =====================
 
    --:ApplyDamageTokenmod|Parameters are tokenid;bar#;amount
        --@token-mod|_ignore-selected _ids [%1%] _set statusmarkers|Paralizzato|Poisoned bar[%2%]_value|-[%3%]
    --<| 
     
    --/|Just a dummy routine that doesn't do anything, but it is easier to do it this way than adding logic to see if we are
    --/|skipping applying damage in the main routine.
    --:DontApplyDamage|
    --<|
    --:UsaAp|
        --=ApDisp|[$ApDisp] - [$ApCost]
        --@modattr|_charid [*S:character_id] _Ap|-[$ApCost]
    --<|
  
    --:PlayEffects|Parameters are : sourcetoken; targettoken; source effect; target effect; line effect; sound effect
        --vtoken|[%1%] [%3%]
        --vtoken|[%2%] [%4%]
        --vbetweentokens|[%1%] [%2%] [%5%]
        --@roll20AM|_audio,play,nomenu|[%6%]
    --<|
  }}        
 
				
			 
 
 
 
 
 
 
 
 
 
 
