if mouse_check_button_pressed(mb_left)
{
//Loop through all instances of obj_door
with obj_door
{
//Check distance is within a certain range
if point_distance(x, y, other.x, other.y) < 64
//Check the direction from the player to the door
//is facing mostly the same way as the player's yaw(or facing angle\direction of the view)
&& abs(angle_difference(point_direction(other.x, other.y, x, y), other.yaw)) < 90
{
open = !open;
//This will probably be the only door the player is near to, so you can break the loop here
break;
}
}
}