You wrote the exact same event for two categories. The computer reads top-down. It sees, "make items visible" before it sees "make them invisible." This means that every time you press esc, Construct 2 can't read the bottom coding. Try adding an, "if items are visible" statement. It would help a lot if you could upload a .capx of the game.