# How to make a move that damages the player??

#### Drago the Shinigami

##### The KING of the Shinigami!
Umm, I'm having trouble creating a move that damages the user an equal amount as the target, can anyone help me with this? I don't know how to do this.

#### Drago the Shinigami

##### The KING of the Shinigami!
I just took a look at it, and I'm not sure if that would help, because the damage taken isn't a fixed number or percentage. The formula is
(a.atk * 4 - b.def * 2) * a.level.

#### AceOfAces_Mod

##### Engineering to infinity!
I'm not sure if what I'm thinking matches with what you want, but from what I understand you want the skill to return back the same damage the skill deals as a recoil damage. I think that there is a way, but I'll need to do some research on this.

#### Drago the Shinigami

##### The KING of the Shinigami!
Thank you. Don't worry, I'm not in a huge rush.

#### Andar

##### Veteran
there is absolutely no need for a script or plugin here, just use direct damage coding.

Code:
``r=(damage formula); a.hp-=r; r``
untested, so the syntax for MV might be something slightly different

r defines a new temporary variable named r to store the damage number of whatever formula you want
a.hp-=r reduces the hp of the skill user by r
and you need to set r again as the number for the damage.

This does not reduce damage in case that the target has less HP left, that would make the damage formula a bit more complex by adding a few more commands for comparison and checks.

#### Drago the Shinigami

##### The KING of the Shinigami!
there is absolutely no need for a script or plugin here, just use direct damage coding.

Code:
``r=(damage formula); a.hp-=r; r``
untested, so the syntax for MV might be something slightly different

r defines a new temporary variable named r to store the damage number of whatever formula you want
a.hp-=r reduces the hp of the skill user by r
and you need to set r again as the number for the damage.

This does not reduce damage in case that the target has less HP left, that would make the damage formula a bit more complex by adding a few more commands for comparison and checks.

Ummm... sorry, I'm new to this. Where do I put the code?

#### AceOfAces_Mod

##### Engineering to infinity!
I think you place this to the damage formula box. Make sure to place your current formula between the ().

#### Drago the Shinigami

##### The KING of the Shinigami!
I put the code in the damage box, and it isn't working. Any other ideas on where to put it?

#### Naveed

##### Veteran
You could post what you put in the damage box so we could tell if you put anything wrong.

On another note, if you're using Yanfly's Skill Core, you can use this notetag on the skill (no need to replace anything):

<Post-Damage Eval>
user.gainHp(-value);
user.startDamagePopup();
user.clearResult();
</Post-Damage Eval>

### Latest Profile Posts

Well, I'm quickly recovering from Covid, but I'm still broke and injured lol. I miss working on my game! I think I've figured out a lore-friendly way to do a tutorial section separate from the main gameplay, but it'll take some scripting know-how. Which I don't have. And can't afford.
Made these sprites by editing Tonbi's materials.

I think Kipling said it best.

If you can make one heap of all your winnings
And risk it on one turn of pitch-and-toss,
And lose, and start again at your beginnings
(...)
Yours is the Earth and everything that's in it,
⁠And—which is more—you'll be a Man, my son!

Do you feel like your modern cities are too clean? I made some dumpsters and trash variations. Visit my MZ resource thread (link in signature).

118,580
Messages
1,117,118
Members
155,648
Latest member
SatansTeaParty