This is a template for anyone who wants to make a game with an on/off switch to control the music in your project. It took me a while to figure this out, so please mention this in your projects that you use it in so that others can use this. You can remove the background and change the music in your project, but if you change the code that I said that was required, it won't work!
Made by me.