Scriptname PCKP_Script_KillSpell extends ObjectReference Projectile Property LightPortal autoProjectile Property DarkPortal autoFormList Property PortalProjList autoObjectReference Property Smokey autoEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked)if akProjectile==LightPortal || akProjectile == DarkPortal ObjectReference TheProj = Game.FindClosestReferenceOfAnyTypeInListFromRef(PortalProjList, Smokey, 50.0) TheProj.disable() TheProj.delete() endifendEvent
The reason I'm doing this is as a bassackwards method of casting a Projectile as an ObjectReference, something that cannot normally be done. The script compiles fine, and my list contains the Projectiles in question. But, the script seemingly does nothing in game.
I've attempted several scripts using this function in the past, and no matter what I do I always get a NONE as a return value for it.
What am I doing wrong here?