Destroying Certain Amount of Objects

Hey Guys

I been trying to figure this out and I was wondering how I would approach this. I have 5 objects in a room and what I want to happen is when all of the objects gets destroyed, a door(or collectible,etc) will be available.

Here is what I have

Code:
/// Destroy

if (obj_door >= 5) && instance_destroy() {

instance_create(x,y, obj_coins)

}
I put this code in the door which is about to collide to the player And I have the player have a door valuable. But when I destroy the objects, nothing shows up.
 

obscene

Member
instance_number() will let you know how many of a certain object exist in a room.

Instance_destroy() destroys and instance BTW, it's not something you check.
 
Top