oops I made a mistake, I think wait has to be equal to the frame number in spanim