In ES4 CS I made the same script however it used the GetFirstRef function which I dont think works in papyrus.
Below is the script I used previously
ref curActorshort cantWait; set to 1 if we find a hostile actorshort doOncebegin gameMode set cantWait to 0 set curActor to GetFirstRef 69 ; find the first actor within the player's area Label 10; use a loop to iterate over all actors in the area if (curActor); did we get a valid actor? if (curActor.GetDead == 0) if (curActor.getAV aggression > 5 && curActor.getDisposition player < curActor.getAV aggression && curActor.GetDistance player <= 2000 ); is true if actor is hostile set cantWait to 1 endif endif if (cantWait == 0); if we didn't find any hostile actors yet... set curActor to GetNextRef; then get next actor... Goto 10; and go to top of loop endif endif ; end of loop if cantWait == 1if doOnce == 0 if ((player.getequipped sting == 1) && (player.isweaponout == 1) && ((getcurrenttime < 5) || (getcurrenttime > 19)) || (player.IsInInterior == 1) || (IsRaining == 1)) Player.PlayMagicShaderVisuals effectFrostShield, 3 set doOnce to 1 endif endif else Player.StopMagicShaderVisuals effectFrostShield set doOnce to 0 endif
Is there a way to search for actors within an area using papyrus?
Any help would be much appreciated.
Thanks
