Maybe this will work.
1.) go to enemy character
2.) go to "pick by comparison"
3.) insert distance formula into pick by comparison
value 1: distance( enemy.X, enemy.Y, player.X, player.Y)
comparison: whatever you choose
value 2: whatever you choose
4.) create sub event under first event
5.) go to enemy character
6.) "compare x position"
comparison: greater than Set angle to 180
x coordinate: player.x
7.) set angle to 180
8.) create another sub event
go to enemy
go to compare x position
comparison: less than Set angle to 0
x coordinate: player.X
9.) set angle to 0