IDK if I got it right (I basically just added lots of if commands) but you use A and D to move.
BTW, @GoTH_CaT3489 you might want to stop greg from twerking when he is idle because it causes a lot of problems with the script, I think I fixed it all but if that turns out not to be the case you might want to just get rid of it.