Make a different action sequence for melee weapons and ranged weapons (Attack command)

I have make an action sequence for the Attack command where actors/ennemis go in front of the target and attack. It's perfect for actors with melee weapons but not for actor with ranged weapons. So, how can I make that only actor with melee weapons go in front of the target for attack and actor with ranged weapons stay where they are for attack.


I'm sorry if you understand what I wrote ^^' and thank you if you have an idea or a solution.


(action sequence)


<setup action>


display action


immortal: targets, true


perform start


wait for movement


</setup action>


<target action>


motion wait: user


wait for movement


move user: target, front base, 30


wait for movement


wait: 10


motion attack: user


wait for movement


wait: 10


action animation


wait for animation


action effect: target


death break


</target action>


<finish action>


immortal: targets, false


clear battle log


perform finish


wait for movement


</finish action>
if user.attackMotion() !== 'missile'


   stuff happens


else


   stuff happens


end


What this says is if the users attack motion isn't missile, do this, otherwise if it is missile do this


Also, try this topic if you get stuck next time, the guys here really know what they're doing


http://forums.rpgmakerweb.com/index.php?/topic/46691-pre-made-yanflys-action-sequence-sharing-and-discussions/
How do I let the game know something is a missile attack?
How do I let the game know something is a missile attack?
In System, where you can see all the weapon types you have, you can change the sprite they use and the attack type (i think slash, stab and missile)

Original thread: https://forums.rpgmakerweb.com/threads/make-a-different-action-sequence-for-melee-weapons-and-ranged-weapons-attack-command.60913/