Jump to content

Need help with a script to toggle a spell effect off when magicka &#60


brothir

Recommended Posts

I'm making a mod where I rework spells such as Night Eye to be toggleable. They are also supposed to end when the user has no magicka left.

Scriptname aaaNightEyeScriptEffect

Begin ScriptEffectStart

	If ( player.IsSpellTarget NightEyeScriptEffect == 0 )
		player.AddSpell NightEyeScriptEffect 
	else
		player.RemoveSpell NightEyeScriptEffect
	endif

End


Begin ScriptEffectUpdate

	if ( player.GetActorValue Magicka < 1 )
		player.RemoveSpell NightEyeScriptEffect
	endif

End

The problem here is with the ScriptEffectUpdate: it doesn't end the spell when the user's magicka is less than 1 (or any value for that matter, tested it on <10 etc.). For reference, the NightEyeScriptEffect is an ability that grants Night Eye and damages 4 magicka, so that every second you have the spell active you lose 4 magicka.

 

Any help would be much appreciated.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...