So, I've tried different methods, and no dice, so I figured i'd bring the issue up here.
So i'm trying to make a move that, if the opponent is defeated by it, the normal sound that plays is changed to be a different sound, and an explosion appears over the opponents body. I tried everything I can think of, and this is the latest concoction of code I mustered. Sadly all this code manages to is play the normal sound effect, regardless of whether the opponent was KO'd or not, with no explosion showing up at all. This state is for the end of the attack and not the attack itself.
Here's the code:
Spoiler, click to toggle visibilty
Also, is there a method for making a defeated opponent remain invisible, even after the custom state is over with? Any help would be vastly appreciated.