room_restart

This function will restart the current room, as if it had just been entered. Note that the room will not restart until the end of the event where the function was called, so any code after this has been called will still run if in the same event. This function will also trigger the Room End event.

NOTE You will not be able to create new instances of objects in the same event after this function is called. There is one exception: if the object you're creating an instance of is already marked persistent, or its persistent variable is set to true in the variable struct passed into the instance_create_*() function, it will be created.

In the latter case (making the new instance persistent through the variable struct), the Variable Definitions for that instance will not be executed.

 

Syntax:

room_restart();

 

Returns:

N/A

 

Example:

if lives < 1 room_restart();

The above code checks to see if the variable "lives" is less than 1 and if it is it will restart the room.