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

Terrible Writing Advice, you've done it again.
1635026211997.png
Feeling like my new profile picture is nice. Thinking of making it semi-permanent, does any one has an opinion? Does it look too evil or does it work as a public profile picture? :)
Bishiba.png
My washing machine is a supernatural being. I lost a piece of clothing in there a month ago; searched up and down, inside other clothes, nothing. It just vanished.
Today, put in a new load. When I pull it out, the missing clothing is back! And a sock was sacrificed in the process :yswt2:

Forum statistics

Threads
116,031
Messages
1,095,090
Members
151,358
Latest member
a_single_firefly
Top