Attach a pivot to the enemy to act as their eyes.
Pointentity this pivot to the target then do an entitypick.
If the pick can see your target then check the EntityYaw of the pivot for your field of view e.g. for a 90 degree field of view do
If abs(entityyaw(lookpivot))<45
;Turn toward player etc...
Pointentity this pivot to the target then do an entitypick.
If the pick can see your target then check the EntityYaw of the pivot for your field of view e.g. for a 90 degree field of view do
If abs(entityyaw(lookpivot))<45
;Turn toward player etc...