Hello guys, i recently started with papyrus scripting and i really need help with a script that won't work. What i'm trying to do right now is casting a heal on my character every time he swings with a weapon. I'mputting the script here so if anyone can tell me what i'm doing wrong it will be very helpful
ScriptName MyScript Extends ActiveMagicEffect
Spell property HealingRightHand Auto
Actor SelfRef
Event OnEffectStart(Actor akTarget, Actor akCaster)
SelfRef = akCaster
RegisterForAnimationEvent(SelfRef, "weaponSwing")
EndEvent
Event OnEffectFinish(Actor akTarget, Actor akCaster)
EndEvent
Event OnAnimationEvent(ObjectReference akSource, string EventName)
If (eventName == "weaponSwing")
HealingRightHand.cast(SelfRef, SelfRef)
EndIf
EndEvent