the "timer" block in scratch is buggy; sometimes the timer doesn't reset to 0 when pressing the green flag, which in this case makes the project de-synced. this is fixed by recording what the timer is in an "offset" variable, and the difference between this and the timer is used instead. have fun! :)