You can put one entity on end of the path, and when your moving entity get close to this point then remove your moveontrack entity
if(vec_dist(my.x,flag_ent.x) < 50){ ent_remove(me);}