50% chance to die after using a skill

So i made a skill called rapture and every time you cast that skill you have 50% chance to die,

but the problem is i dont know how to make it work like that.

Do i need a script or something,can somone tell me please.

Thanks and sry on my bad english.
make the skill call a common event and put this snippet in the script call command of the common event,

(rand > 0.5) ? BattleManager.actor.hp -= 9999 : nilNot tried, should work.
As an addendum to the above, you can do something similar in the formula box of the skill. If you do it in the formula box it would look like  ■ ᴆᴈᴋᴉᴦᴀ ■'s code, except that BattleManager.actor.hp would become a.hp.
Yeah using custom formulas for the skills is the way to go if you are using VX or VXAce. It's amazing what you can do in the skill formula box 🙂
WOW.That was fast,thanks
Yeah using custom formulas for the skills is the way to go if you are using VX or VXAce. It's amazing what you can do in the skill formula box 🙂
This is true... For example...

Put this in skill formula box...

a.my_awesome_skill(a,Then add this cheeky little snippet in a script page...

# Opens Classclass Game_Battler # Defines custom skill formula def my_awesome_skill(a, # Get attack value atk_val = (a.atk + a.mat * 5) / 2 # Get defence value def_val = (b.def + b.mdf * 5) / 2 # Get total value tot_val = atk_val * (def_val / 2) * a.hp_rate # Take all attacker hp if rand > 0.5 (50% randomness) if (rand >= 0.5) a.hp -= a.hp end # Take all attackers mp if damage was 0 or negative if (tot_val <= 0) a.mp -= a.mp end # Add State 5 To attacker if its hp rate is greater than enemies if (a.hp_rate > b.hp_rate) a.add_state(5) else # Add the same state to the enemy if not b.add_state(5) end # End Custom Skill Formula and return damage value return tot_val end # End ClassendHave fun with that 😛

Keep in mind though, all these modifications take place way before the total damage value is determined as the formula is only the first part of the overall process.
This is true... For example...

Put this in skill formula box...
Nothing I would ever be able to put in as a skill formula xd

That shows my point even more, amazing on what can be done in that text box 😛

Even though I just use very basic formulas in there haha.
Yea, I usually just put mega simple things there too, like '100', but then again, I code in thousands of lines worth of modifications too, so... 😛

Original thread: https://forums.rpgmakerweb.com/threads/50-chance-to-die-after-using-a-skill.38270/