I've solved it! I put all the code in a timer, and when PlayState occurs I activated the Timer.