This script works great, but I would not mind making it "sixier" and more efficient if anyone see where I can make improvements.
Scriptname aadpParkourScpt extends activemagiceffect
float StartZactor meactor Property PlayerRef autoSound Property aadpBodyfallHitSD Autoint clampfloat TimeFactorfloat JumpFallLandCrashGlobalVariable Property aadpJumpFallLandCrash AutoSPELL Property aadpstagger Auto Event OnEffectStart(Actor akTarget, Actor akCaster)ME = akTarget as actorif aadpJumpFallLandCrash.GetValue() == 0.0Shutdown()elseSetUp()endifendeventEvent OnAnimationEvent(ObjectReference akSource, String asEventName)If akSource == Me If asEventName == "RemoveCharacterControllerFromWorld" || asEventName == "GetUpstart" || asEventName == "GetUpBegin" StartZ = 9999.9 endifif JumpFallLandCrash != 0.0If asEventName == "JumpFall" || asEventName == "JumpUp"StartZ = Me.GetPositionZ();debug.messagebox("start fall")Clamp = 1endifIf asEventName == "JumpDown"Clamp = 0float FallDist = 0.0if StartZ != 9999.9FallDist = math.abs(StartZ - Me.GetPositionZ())StartZ = 9999.9if !Me.getAnimationVariableBool("IsStaggering")if me != playerrefif !Playerref.HasLOS(me)returnendifTimeFactor = 1.0elseTimeFactor = 1.1 - (Utility.GetCurrentRealTime() - TimeFactor)if timefactor < 0.0timefactor = 0.0endifendifTimeFactor = 0.5 + (0.5 * TimeFactor)float CrashNum = JumpFallLandCrash * (0.8 + ( me.getActorValue("sneak") * TimeFactor * 0.012 * me.getActorValuePercentage("stamina")))Float FalCrsh = FallDist - CrashNum;debug.messagebox(FallDist + " >= " + CrashNum)if FallDist >= (CrashNum * 1.5);me.Say(HurtSound) cannot get this to work, :(me.damageActorValue("health", math.Ceiling(( me.getActorValue("health") * 0.003 * FalCrsh)))aadpBodyfallHitSD.play(me)Me.PushActorAway(Me, -5.0)elseif FallDist >= CrashNumme.damageActorValue("health", math.Ceiling(( me.getActorValue("health") * 0.001 * FalCrsh)));me.Say(HurtSound)aadpstagger.cast(Me, Me)utility.wait(0.2 + (FalCrsh * 0.004))Debug.SendAnimationEvent(Me, "staggerstop")elseif FallDist >= 140.0 && TimeFactor >= 0.6me.StartSneaking()Debug.SendAnimationEvent(Me, "SneakSprintStartRoll")utility.wait(1.0) me.StartSneaking()endifendifendifendifendifendifEndEventEvent OnObjectequipped(Form akBaseObject, ObjectReference akReference)if aadpJumpFallLandCrash.GetValue() == 0.0Shutdown()elseSetUp()endifendeventEvent OnControlDown(string control)if JumpFallLandCrash == 0.0returnendif If control == "jump" && Clamp == 1 TimeFactor = Utility.GetCurrentRealTime() clamp = 2 EndIfEndEventFunction Shutdown()if me == playerrefunRegisterForControl("jump")endifunRegisterForMenu("Loading Menu")JumpFallLandCrash = 0.0 unRegisterForAnimationEvent(Me, "RemoveCharacterControllerFromWorld") unRegisterForAnimationEvent(Me, "GetUpBegin") unRegisterForAnimationEvent(Me, "GetUpStart")unRegisterForAnimationEvent(Me, "JumpDown")unRegisterForAnimationEvent(Me, "JumpFall")unRegisterForAnimationEvent(Me, "JumpUp")StartZ = 9999.9endfunctionFunction SetUp()if me == playerrefRegisterForControl("jump")endif RegisterForMenu("Loading Menu")JumpFallLandCrash = (aadpJumpFallLandCrash.GetValue() * 20.0) RegisterForAnimationEvent(Me, "RemoveCharacterControllerFromWorld") RegisterForAnimationEvent(Me, "GetUpBegin") RegisterForAnimationEvent(Me, "GetUpStart")RegisterForAnimationEvent(Me, "JumpDown")RegisterForAnimationEvent(Me, "JumpFall")RegisterForAnimationEvent(Me, "JumpUp")StartZ = 9999.9endfunction