Trying to use a buzzer, tone and noTone freeze my program

Well that code was quickly taken put of something bigger so I made mistakes when I copy pastes it but they are still not going to make a difference when I use tone one way or another in my loop it freezes my loop and nothing after it is executed.

I found a new library for a newer version of tone hope this one doesn't do that.