[XP] Help changing MC's appeareance with Winkio's simple player idle sprites script

Hello. In my game, you can enter a wardrobe and you can change your character's sprite. It works accordingly except for the part where you move and the sprite inmediately changes to the original. This is the link to the original script:

Spoiler: SCRIPT

I suspected that maybe this was because of the script changing the MC's sprite to the one that they're suppossed to have according to their name in the database. So I made it so that when you change sprites, it also changes your name, and I added a new line so that the sprite applied to the MC's new name was the new one, and I also made an idle animation for that sprite. However this didn't work either, the same issue happened: everything goes right until you move, and your character goes back to the original sprite. This was probably because I'm new at Ruby and I didn't write the code right, but it didn't throw any error. By the way, I know it is the script because when I take it out changing the MC's sprite works perfectly.

Hopefully I explained myself well enough.
How exactly are you changing them? I've read the script but it's not for "changing wardrobes" or anything the like. It's just for an idle sequence...
How exactly are you changing them? I've read the script but it's not for "changing wardrobes" or anything the like. It's just for an idle sequence...
I know. Sorry, I didn't clarify. I meant that I have a "wardrobe" feature in my game (it doesn't have a script, it's just events that change the MC's graphic), but the script will switch my character's sprite to the original when changing appearance. So I wanted to know if there was a way to force the script into not changing the character's sprite.

Original thread: https://forums.rpgmakerweb.com/threads/xp-help-changing-mcs-appeareance-with-winkios-simple-player-idle-sprites-script.155842/