How to have only Left/Right sprites show, even when pressing up or down.

Sorry if this is the wrong thread, I am new to this forum site. I was wondering if there is a way to somehow only have Left/Right sprites show, something like Sonic Battle. I tried looking online, but couldn't figure anything out, and I tried getting ChatGPT to make a plugin that could do it, but that didn't work. I am very confused on what to do.
If you're not disabling up/down movement, you just want to change the images...why don't you simply edit the spritesheet and paste the left/right images on top of the up/down images?

If you do want to also disable the movement (which you didn't specify), you should be able to Google for little plugins to do that. I know I've posted code for someone before for that purpose.

If you can't find anything and need more help, let us know with specific details.

ChatGPT is not a helpful tool to generate code if you don't already know how to code. It doesn't consistently create code that actually works without debugging/correcting it.
If you're not disabling up/down movement, you just want to change the images...why don't you simply edit the spritesheet and paste the left/right images on top of the up/down images?
Because, that means it'll flip if you hit up or down.
I had these scripts laying around and they do work in MZ. Credit to Quasi who made them, but this might be what you're looking for. The horizontal script locks the directions left and right for the sprites, so when you walk up and down, it should remain in those directions. The vertical works the same way, but just for vertical directions.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-have-only-left-right-sprites-show-even-when-pressing-up-or-down.157023/