What I want to happen, on hit, the actor with the script on it will cast a stagger effect onto the player. However this never works right, because akSource confuses the function when I compile. If I use PlayerRef in both the target and the source slots, it doens't work (but it will compile!).
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)PlayerRef = Game.GetPlayer()Current2hSkill = PlayerRef.GetActorValue("TwoHanded") as intif akAggressor == PlayerRef && akSource as Weapon ;if ((Utility.RandomInt(1, 100) as int) - (Current2hSkill / 2)) > 100 CPOStaggerSpell.Cast(akSource, PlayerRef) PlayerGotStaggered2H.SetValue(1) ;endifendifEndEvent(i've commented out the random number gen, so each hit should 100% cause the spell to cast)
Error:
Starting 1 compile threads for 1 files...Compiling "TwoHandedGlobalStaggerCheckScript"...e:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TwoHandedGlobalStaggerCheckScript.psc(15,19): type mismatch on parameter 1 (did you forget a cast?)No output generated for TwoHandedGlobalStaggerCheckScript, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on TwoHandedGlobalStaggerCheckScript
