Script animation with pause, resume and restart