How to get enemy to follow X and Y location

Hello  :)
I am new to Stencyl and am attempting to make my first game after watching a few free courses online.

I am making a top down vertical scroller where the player makes his way up the screen and encounters enemies. I have managed to get what I need to work on both the X and Y position separately, but when trying to enable both at the same time, the enemy direction and animations go completely wrong and they barely move.

I want the enemy to stay in line with my player as he moves on the x axis, but also to approach my player but stop when he gets within a certain distance as I will then be making a behaviour for him to shoot player.

I have attached both my logic for the x and Y tracking and will appreciate any help I can get :)