Roughly describing it, it calculates the diection that the enemy has to be facing, and tells the enemy which way is closest(left or right). It then rotates until it is facing the player object, or whatever the enemy is supposed to be facing. Hmph. I noticed that the code STILL isn't completely posted. I'll try it here:
Rem Get the player's positions
Posx#=[player position x]
Posz#=[player position z]
Rem Get the enemy's positions
x#=[enemy position x]
z#=[enemy position z]
Rem Calculate the angle that the enemy has to rotate in order to facing the player
Angle#=wrapvalue(atanfull((Posx#-x#),(posz#-Posz#)))
Rem If object is closer to the left, then rotate left, and if object is closer to right, then Rem rotate right
If object angle y([enemy])>Angle# then Left#=1 : Right#=0
If object angle y([enemy])<Angle# then Right#=1 : Left#=0
Rem Have the enemy rotate toward the player
If Left#=1 then yrotate object [enemy],wrapvalue(object angle y([enemy])-0.5)
If Right#=1 then yrotate object [enemy],wrapvalue(object angle y([enemy])+0.5)
move object [enemy],1
There. If anyone wants anything else, please ask!
-Aramil