This function will return an array populated with the unique ID values of each layer in the room.
layer_get_all()
Array (1D, populated with Layer IDs)
var a = layer_get_all();
for (var i = 0; i < array_length_1d(a); i++;)
{
layer_destroy(a[i]);
}
The above code retrieves all the layers in a room and adds thei rID values to an array. This array is then parsed to destroy or the room layers.