self.IsInCombatself.GetCombatTarget playerself.GetFactionRelation player == 1self.GetDetected player
ref MyRefbegin GameModeset MyRef to GetSelf ;now GetSelf is the reference of your actorself.IsInCombatself.GetCombatTarget playerself.GetFactionRelation player == 1self.GetDetected playerend
set refVar to GetFirstRef 200 1label 10if(refVar) ;Do whatever set refVar to GetNextRef goto 10endif
set refVar to GetFirstRef 200 1label 10if(refVar) ;Do whatever set refVar to GetNextRef goto 10endif