This function returns whether an object with the specified index exists or not. Note that this checks to see if an object is present in the resource tree, and not actually in the game room. For that you should use the function instance_exists.
|obj||The index of the object to check.|
with (obj_Temp) scr_add_event();
The above code checks the variable "obj_temp" to make sure that it stores the index of an object and then, if it does, it makes the object run a script.