Trying (and failing) to turn off a switch.

I'm extremely new to RMMZ, so I'm hoping someone can point out where I'm making a mistake.

I made a very simple common event clock (using this tutorial). It displays the clock in the corner when the Display Time switch is turned on.

At any point you can walk the character to the bed, click on it, and be transported to the "sleep" map. When that happens, the clock display disappears. All good so far. I want it to be gone when on the "sleep" map. It then returns when the character wakes up. Perfect, no issues.

However, I created a common event so that at a specific time, the characters is forced to go to bed. It does basically the same thing as clicking on the bed. The only difference is the bed asks if you want to sleep first, while this just happens. It transfers to the same "sleep" map. Except that the clock display does not disappear. It remains in the corner. And I want it gone.

This is the forced sleep event:

1746506343420.png


Once on the "sleep" map, this is the only event (dancing ZZZZs on the screen then transfer back to home)

1746506583905.png


And this when you click on the bed instead of being forced to sleep.

1746506673115.png

I changed the commen event page for the display to be slightly different than the tutorial, changing it to an "if/else" statement, so that it shows the clock times when on but shows blank images when off. That was my first attempt to fix it. I also added the "turn the switch off" code a bunch of times, in its own map events, to the already existing map event, changed from autorun to parallel and back again.

Does anyone have any ideas? Why does clicking on the bed remove the clock while being forced to sleep does not?
can you please give full screenshots of your events?
it is difficulty to see what went wrong without seeing the properties of the event, which are as important as the content itself.

and please show screenshots of your time and time display events as well - there have been a lot of cases where a tutorial was fo9llowed wrong, and we need to see what you have done instead of what you were supposed to do.
No problem. Sorry, didn't want to overwhelm the post with images.

Sorry it's a lot. Here are attached screenshots for the Common Events: Time Counting, Display Time, and (forced) Bedtime. Then the map event for clicking on the bed to sleep. And finally the full map event for the Sleep map.

I just want the time to not display when on the sleep map. It works fine when I click on the bed to sleep, but not when forced to sleep.

Thanks so much!
Sounds like it might a weird timing based issue.
Have you tried simply erasing pictures 1 and 2 in the sleep map?

Unrelated to the problem, but I recommend checking out the Mod operation in control variables - it would allow you to check for a weekend with a single conditional branch.
I haven't messed with the modulo operation yet. I'm still learning, so I'm following things on youtube to see how they work.

What exactly do you mean to erase? The image bouncing up and down and the conditional branches for the level?
What exactly do you mean to erase?
This command:
RPGMV_2025-05-07_14-34-26.png

If you're unfamiliar with it, I'd recommend going through the engine's built-in tutorial - it should help you familiarise yourself with the basics.

Original thread: https://forums.rpgmakerweb.com/threads/trying-and-failing-to-turn-off-a-switch.177456/