To have the enemy attack from a distance you need use the distance() expresssion
distance(x1, y1, x2, y2) Calculate distance between to points
so in your case
system - every tick - compare distance(player.x, player.y, enemy.x, enemy.y) < 20
----do actions
2)
For the enemy characters turn off the property "has control" if you are using the platform behavior on it.