Jump to content

[LE] What event to use to detect when any enemy is hit by a lightning bolt?


Recommended Posts

I am trying to find the right event to use that will detect when any enemy is hit by a lightning bolt. This is the script I tried:

 

Scriptname EyeOfTheStormFixedScript extends activemagiceffect


Event OnEffectStart(Actor akTarget, Actor akCaster)

	If (akCaster == Game.GetPlayer())
		Debug.Notification("You hit the enemy with lightning bolt.")
	EndIf

EndEvent

However that does nothing. I attached that script to the lightning bolt magic effect.

 

Link to comment
Share on other sites

Follow this tutorial to dynamically attach scripts to nearby actors, and add a script extending ReferenceAlias or MagicEffect depending on which method you picked.

 

Add this to the script

MagicEffect Property LightningBolt Auto ;fill this property with actual lightning bolt magiceffect

Event OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect)

If akEffect == LightningBolt
	
	Debug.Notification("hit with bolt")
	
EndIF

EndEvent

Or you could use Event OnHit I guess.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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