- 2
- Posts
- 5
- Years
- Seen Jan 16, 2024
Im having trouble with an ability that makes biting moves act like giga drain, also doesnt help that im incredibly new to scripting.
This is my script ive wrote:
Battle::AbilityEffects::DamageCalcFromUser.add(:CARNIVORE,
proc { |ability, user, target, move, mults, baseDmg, type|
if move.bitingMove?
original_target_hp = target.hp
damage_dealt = target.pbReduceHP(baseDmg, false)
target.pbFaint if target.hp <= 0
hp_restored = original_target_hp - target.hp
user.pbRecoverHP(hp_restored) if hp_restored > 0
end
}
)
But its working kind of weird, hard to explain in words so heres a short video of what im talking about.
Im trying to get the healing exactly like how giga drain works is there anything i can do?
This is my script ive wrote:
Battle::AbilityEffects::DamageCalcFromUser.add(:CARNIVORE,
proc { |ability, user, target, move, mults, baseDmg, type|
if move.bitingMove?
original_target_hp = target.hp
damage_dealt = target.pbReduceHP(baseDmg, false)
target.pbFaint if target.hp <= 0
hp_restored = original_target_hp - target.hp
user.pbRecoverHP(hp_restored) if hp_restored > 0
end
}
)
But its working kind of weird, hard to explain in words so heres a short video of what im talking about.