I've implemented the Yann's method and it worked very well, I also used different animations instead of anim.frames so It looked like:
"animation"&str(ceil(4*(1+angle(waypoint.X,waypoint.Y,units.X,units.Y)/360)-0.5)%4)
many thanks to Noga too for those useful tips and solutions ;)