Dodge mechanic

I have the yanfly's button common events plugin for the button part, but how do I keep the player facing up or down whilst dodging to the left or right and how can I prevent the player from spamming it without adding a long wait time?
the first part is to turn direction fix on while moving and off after that.

as for the second part, that depends on how exactly you made your events and what you want to happen, so please give a screenshot of the event commands and a better description.
Is this how it's supposed to look?
Delete the 5 Frame Wait. The rest should be fine.
That was a bad example, I actually want it to be in any direction not just to the right.
you need to give us a better description.
if it is supposed to be able to go in multiple directions, then how is the computer going to determine which direction? randomly? because the computer can't read your or the players mind.

and what do you want to happen if the player tries to spam the button? I asked that before because without knowing what should happen we can't tell you how to code it.
if you want all direction, use condtional branch.
and use scriptcall when the player pressed left, right, up or down.
than the move route as above (wthout waitframe) and it should work.

but still, you need something to trigger the common event so it doesn't always
run that, switch is ON and turn it OFF on the end when not needed.

but it might be more complext, which is better if you hold the button "SHIFT" or "CTRL"
so you can dodge, but than again, is this on map dodge only?
@Andar When I just leave direction fix on I can move in any direction forever, but when I add the direction fix off it cancels it out and I want the player to stop without a frame so the player can't spam it.

Original thread: https://forums.rpgmakerweb.com/threads/dodge-mechanic.124863/