RMMV Effect when enemy dies (YEP Buff & States Core)

Maronius

Villager
Member
Joined
Oct 29, 2015
Messages
21
Reaction score
4
Primarily Uses
Hello everyone,

I'm trying to make a state that heals the Magic Points of the Actor who kills the enemy.

With YEP Buff & States Core this should be easy, and I tried this:


<Custom Deselect Effect>
if (target.hp <= 0) {
user.gainMp(1000);
}
</Custom Deselect Effect>

But unfortunately this doesn't have any effect on the actor that kills the enemy with this state.
Can somebody give me a hint what's wrong here?
 

Jules98

Veteran
Veteran
Joined
Jul 10, 2017
Messages
339
Reaction score
224
First Language
Dutch
Primarily Uses
RMMV
The code you posted works fine on my end.

I can think of 3 possible reasons why it's not working for you.
  1. The state isn't actually active on the target when it is killed.
  2. There is something wrong with the state. Please post a screenshot of the database entry of the state, including whatever else is in the note box.
  3. There is a problem with your plugins (wrong order, conflicting plugins, etc). Please post a screenshot of your plugin manager so we can check this.
 

Maronius

Villager
Member
Joined
Oct 29, 2015
Messages
21
Reaction score
4
Primarily Uses
Alright, thanks for checking this out. Looks some other scripts are overriding the "enemy dead" handling, as only "if (target.hp <= 0)" isn't working out, all other "ifs" I tried are working right.
I'll check my plugins for this.
 

Latest Threads

Latest Posts

Latest Profile Posts

Anyone going to talk about Chris Pratt Mario?
My friend just gave me chocolate milk at lunch today! My day is now 1000x better. Yay, choco milky!! :kaojoy:
RivalRamen_Games wrote on jacobv1014's profile.
I really like your profile picture! Who is that in it? is she an OC?
Making his first game

Forum statistics

Threads
115,331
Messages
1,089,077
Members
149,999
Latest member
Nasciturus
Top