

If you enter the room, you'll be given detention, but the door will remain open, thus negating the necessity of the Principal's Keys in escaping detention. Suppose you're breaking the school rules near the detention room and the Principal is about to catch you for it. This will prevent the principal from detecting you it will also let your stamina last slightly longer, and the effect on your speed is marginal. To circumvent this, one trick you can do is repeatedly mash the run button - but don't hold it.

When you run in the halls, the principal can come by and, if you run near him, send you into detention.

Note that, in versions before v1.3.1 this is nearly impossible to achieve since Baldi will be abnormally fast in version v1.3 specifically, the secret ending is broken and fails to trigger. There is an alternate ending to the game if you get every single question wrong across all seven of the game's notebooks, on completing the game you'll get a special message and cutscene. Baldi's Basics in Education and Learning Cheats For PC
