Apply Buff to Self on Hit

I have been having a hard time figuring out how to do this. Since when you use a attack the scope is on the enemy the buff always gets applied to the enemy. Is there anyway I can hit an enemy with a skill and have it apply a buff to myself?
Even when I try to do a recover 10 mana on hit it recovers mana for the enemy instead of the caster > <.... What am I missing!
ajilejay, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


If you want to add something, just use the Edit button instead of double posting.


The damage formula applies, by default, to the target, not the user. If you want the user to have something happen, you have to specifically say that in the formula.


So if you want the skill to do 10 damage to the enemy AND give the user 8 mp back, you would write your formula like this:

Code:
a.mp += 8; 10
I'm not sure about adding a buff via the formula though.
my apologies been trying to figure that out for days
ajilejay, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.

If you want to add something, just use the Edit button instead of double posting.

The damage formula applies, by default, to the target, not the user. If you want the user to have something happen, you have to specifically say that in the formula.

So if you want the skill to do 10 damage to the enemy AND give the user 8 mp back, you would write your formula like this:

a.mp += 8; 10I'm not sure about adding a buff via the formula though.
Where else can I add it? When i did this it causes my attack to be = to my mana

EDIT***

Turns out the buff has to be put in first, Thanks again for the help.
Yes, the damage must come last, as that's what the method expects to receive back when executing that formula.


Instead of giving you a warn for double posting AGAIN, after you acknowledged and apologized, I'll explain to you ...


- double posting is when you post twice in a row. This is against the forum rules. If you need to post something new, and the last post is yours and it's less than 72 hours old, then hit the Edit button on the post.


- if what you want to add is a quote (as it is in this case), hit the quote button, copy what you want to quote, then edit your previous post and paste the quote.


- if you want to quote multiple people in a single post, hit the MultiQuote button on each post you want to quote, and when you've selected them all, hit the 'Reply to X quoted post(s)' button.


Anyway, since you seem to have worked out the buff, This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/apply-buff-to-self-on-hit.16259/