Game over screen is playing twice

Link to the project or level:(App Lab - Code.org)
What I expect to happen: Once the game over screen is active, it should only perform the code once
What actually happens: Once the game over screen is active, it should only perform the code once. Instead it repeats it after a few seconds
What I’ve tried: I tried observing what was happening with sending messages to the console but it wasn’t no help. Please someone help me because this is for my grade

Greetings @theonlyboyalexiss,

Since your assignment is being graded I am unaware of how much help I’ll be able to give you though you should probably create a function that takes you to the game over screen and replace all those duplicate lines with that

After you’ve removed all your redundancies you should continue by assigning a boolean values like “gameOver” to your code and test it within the function to see if the call was executed before by using an if statement something along the lines of if( gameOver ){ return } from the function that i was talking about.

you will also have to alter the restart button as well by gameOver to false when your back at your “IntroScreen”

Anyways hope this will be of some use to you