Scriptname ZombieAttackProtocol extends ActorKeyword Property ActorTypeUndead autoKeyword Property ActorTypeNPC autoKeyword Property ArmorCuirass autoKeyword Property ClothingBody autoKeyword Property VendorItemArmor autoKeyword Property VendorItemClothing autoFaction Property AAAZombieFaction autoFormList Property DoorList autoSpell Property AAAZombieTurnAb autoevent OnCellAttach()FindLunch()self.RegisterForSingleUpdate(0.50)endEventfunction FindLunch()Actor Lunchwhile Lunch==NONE ;constantly looking for the next meal while Lunch==Game.GetPlayer() || Lunch.GetRace().HasKeyword(ActorTypeUndead)==true || Lunch.HasKeyword(ActorTypeUndead)==true || Lunch==NONE ||Lunch.IsChild()==true Lunch= Game.FindClosestActorFromRef(self, 2000) Utility.Wait(0.10) endWhile self.StartCombat(Lunch);waits for Lunch to die while Lunch.IsDead()==false Utility.Wait(1) endwhile Lunch=NONEendWhileendFunctionevent OnHit (ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) (akAggressor as Actor).addSpell(AAAZombieTurnAb)endEventevent OnUpdate()if self.IsInCombat()==false FindLunch()endIfself.RegisterForSingleUpdate(3.0)endEventevent OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) if akBaseItem.HasKeyword(VendorItemArmor)==true || akBaseItem.HasKeyword(VendorItemClothing) self.EquipItem(akBaseItem) endIfendEventevent OnCombatStateChanged(Actor akTarget, int aeNewState)if aeNewState==0 self.SetFactionRank(AAAZombieFaction, 1)endIfif aeNewState==1 self.SetFactionRank(AAAZombieFaction, 0)endIfendEvent
But find lunch seems to only run once, if at all. I want it to always be looking for its next meal.

IMO endless WHILE/ENDWHILE's are dangerous. I'd put your scanning logic into an event.
