How can I change "damage property" of a weapon in the script?
If the property is read-only you can't change it, sometimes there are functions to change the value but that does not seam to be the case here so i guess your only choice is to listen to the
from there it can be has simply has to set
Damage.amount = 0 or it can be more complicated.
If you need the Weapon you can try on the
damagedEvent to do
local weapon = Damage.sourceAbility:FindAncestorByType("Weapon")
or if it's an Equipment
local weapon = Damage.sourceAbility:FindAncestorByType("Equipment")
it depends on what you are trying to do.
Damagedevent is called after the damage itself has been dealt.
This is usually not a problem.
But if the damage is more than the player's health, then he is already dead by the time of the call damagedevent.
It was like this last fall, maybe it's different now.
Maybe targetImpactedEvent will help Weapon - Core Documentation
Did not know about that i just glanced at the documentation and tough it might work, have to pay more attention next time. I agree the targetImpactedEvent might work by giving the player the amount of hp that the attack is going to take away.