This is a backrooms game i need nhelp cause it lags and bugs when i play it

Here it is:

First of all, I can’t read the text at the start, so try redoing part of the design for it or change the writing’s color.
Second of all, the repeat 1 time block serves literally no purpose, as it repeats AGAIN when you are on the sprite.
Third of all, to answer your question, all I can possibly say is that all the “when sprite is created” has a number attached to it (ex "when sprite4 is created) , meaning that nothing will happen until one of those sprites spawn, none of which do. Some of these blocks of code can be transported to the start instead of when something happens, but for all the others, just replace the “spritenumber” with the variable needed.

I don’t know if I fixed anything, but I removed the if blocks and the repeat (1) blocks as well. I also changed the sound effects to play in the background so it wouldn’t pause the game.

While trying to optimize what I found was while you definitely had a lot of useless if-statements, the bulk of your lag is coming from those overlapping sounds looping in the background. taking the sound out of your code seemed to make the simulator run at a more normal pace.

sprite overlap functions and tile map size taking exponentially more processing can also slow you down.

And again, your main culprit was the simultaneous looping sounds.