My game is a 2D platformer with multiple rooms, you hit a door to progress to the next room.
I made an empy object I named obj_roomcontrol with an Alarm event with the command room_restart():
Next I placed the spriteless object in all the rooms.
Whenever my character died, an amount of time...