look inside the code to see how it happens how to do it make a variable then make it when you die you change the variable make sure you dont make it to so when green flag is clicked set it 0 or any number and when you are done editing a project set it to 0 (or any number you chose) then save
Toby fox for Undertale and the music is here: https://www.youtube.com/watch?v=auZJIqv01m0