Making a bot try to move towards the same X as the ball. (When in proximity)

Please help.

I am making a table tennis game. (Just search Deadllama and most of my old profiles will pop up, along with the tennis game (last page))

Or did i do it right?

Link to the game (Flowlab Game Creator - Table Tennis)