Instance number

Explanation
This functions returns the number of instances of object obj that exist in the current room. You would normally pass the name of the object as the argument (without quotes!). (The name of the object is actually a constant whose value is an integer that is the id of the object.) but you can also store object ids in variables and use these. A typical use is to check whether all instances of an object have been destroyed.

Example
This is particularly useful if you have a number of instance of an enemy and you want the player to move to the next level after he's destroyed all the enemy. You can also use multiple checks for different objects.

if (instance_number(obj_enemy01) == 0) and (instance_number(obj_enemy02) == 0) {      // Goto the next level / room; }

You can also use the function to create a new monster if there are only a few left.