Scriptname Blink extends activemagiceffect Actor TargetInt DodgeKey float cost = 25.0SPELL Property BlinkFX AutoEvent OnInit() RegisterForKey(48) DodgeKey = 48EndEventEvent onEffectStart(Actor akTarget, Actor akCaster) Target = akTarget RegisterForControl("Jump")EndEventEvent OnKeyDown(Int KeyCode)if (!Utility.IsInMenuMode()) if(KeyCode == DodgeKey && Target.GetActorValue("Magicka") >= cost) BlinkFX.Cast(Target) Target.MoveTo(Target, 120.0 * Math.Sin(Target.GetAngleZ()), 120.0 * Math.Cos(Target.GetAngleZ()), Target.GetHeight() - 35.0) Target.SetGhost(True) Utility.Wait(0.3) Target.SetGhost(False) Target.DamageActorValue("magicka", cost) endifendifEndEvent
I have created this script to allow the player to press "B" to teleport forward (just a small distance, enough to dodge weapon hits but im having 2 problems :
1) if standing still, it causes me to not only teleport forward, but also upward too (like some instant jump)
2) It can pass through walls and any other areas I shouldn't go to, and I have no idea how to fix this
Thanks for help