How to trigger an event with movement

Hi, first of all thanks for reading my post

The situation is pretty simple. My character has a skill that allows him to turn into an specific object when you use the action button in it. Well, I´ve managed to change the character's sprite when you use the action button in the object, but i want the character returns into his regular sprite when the character moves. In other words, if you are transformed and you want to move, your character will return to his human form.

And the question is, how can i trigger this event with the character movement?
If this could happen on any map, I'd set up a parallel process common event triggered by a switch. Then on the event that makes you change the sprite into whatever the player touches, turn on that switch.

In the common event, do this:

Code:
Wait 4 FramesConditional Branch: Script: $game_player.moving?  ... change sprite  ... turn switch offBranch End
I'm getting an error.

[IMG]http://i68.tinypic.com/2z4h7xx.png[/IMG]

These are my settings

[IMG]http://i64.tinypic.com/2an6du.png[/IMG]

[IMG]http://i64.tinypic.com/20jdhk.png[/IMG]
I'm getting an error.
That is because what Shaz gave you is NOT a script, but a sequence of event commands.
Delete the script command, and place the event commands mentioned in that order - the wait command, the conditional branch (with that script command in the script option of the conditional branch), the change sprite command and the control switch command
Thank you! The problem is solved 😀

Original thread: https://forums.rpgmakerweb.com/threads/how-to-trigger-an-event-with-movement.52247/