MZ How to have things happening while in a battle?

Hello! I currently have a code that is set up that after enough damage has been dealt, the enemy will transform and start a script that every couple seconds will have images popping up for 5 frames before disappearing - like a glitching effect.

The problem is that whenever the said script is running, I cannot fight the enemy. I don't know how i can continue the fight while the said script is running. Any help?

The picture provided has the script that has a 30% chance to check which image to use (1 - image1, 2 - image2 etc.)
you show that you made a loop, but you havent shown any condition to break the loop. troop events will stop all battle processes and player input while being ran, so an infinite loop will lock the game.

IMO, you would want a plugin for visual state effects that would let you add a passive animation to affected battlers and use that, or use an animated enemies plugin and have the glitching be a part of their motions
you show that you made a loop, but you havent shown any condition to break the loop. troop events will stop all battle processes and player input while being ran, so an infinite loop will lock the game.

IMO, you would want a plugin for visual state effects that would let you add a passive animation to affected battlers and use that, or use an animated enemies plugin and have the glitching be a part of their motions
got it. thanks

Original thread: https://forums.rpgmakerweb.com/threads/how-to-have-things-happening-while-in-a-battle.179470/