You could create an invisible sprite (I'll pretend it's called "InvisibleSprite") and put it at various points in the map. The more you put in the better because then when you want to get the enemies to run away from the player use an event like this:
By the way this is for a scenario like pacman, but if it was a bit more open world and you want them to run straight away from you there are much easier ways to do this.
Also make sure the enemies have pathfinder and give the invisible sprite an instance variable with initial value of 0... I'm going to pretend the instance variable is called "tracking".
Conditions:
System -> Every Tick
Player -> (whatever you use to indicate when the enemies will run away from the player)
InvisibleSprite -> Pick Nearest/Furthest -> Which: furthest
X: Player.X
Y: Player.Y
Actions:
InvisibleSprite -> Set Value -> Instance Variable: tracking
Value: 1
After this event make another that is like the following:
Conditions:
System -> Every Tick
Player -> (whatever you use to indicate when the enemies will run away from the player)
Actions
Enemy -> Find Path -> X: InvisibleSprite.tracking = 1 ? InvisibleSprite.X : Player.X
Y: InvisibleSprite.tracking = 1 ? InvisibleSprite.Y : Player.Y
InvisibleSprite -> Set Value -> Instance Variable: tracking
Value: InvisibleSprite.tracking = 1 ? 0 : Self.tracking
And finally do one more event like this:
Conditions:
Enemy -> On path found
Actions:
Enemy -> Move along path
That should do it, if it doesn't work either reply to this comment or private message me and I'll find another way to do it or figure out where you went wrong.
-Malcolmtheguy