how to change this Script only move in x position?

Please read the post Using code tags properly .
Otherwise your code is very hard to read and there are less people who want to help.