Here's the old thread for RPGmaker/Yume Nikki fangame help → >>>/fg/165
There you'll find many suggestions on how to make the wake up mechanic, effects, and other fangame related stuff.
If you don't feel like reading it all, click "Control + F" at the same time on your keyboard and write a keyword related to your interest in the box that appears to perform a search on the whole thread for it. (Ex: write "wake" to find posts talking about the wake up mechanic, it's that simple.)
Why am I posting this instead of explaining how to do it? Because that thread has years of useful information for anyone making a fangame in RPGmaker, and will be of better aid than my already rusted knowledge of RPGmaker. Hope it helps.