On Mouse Down Problem

So hi i don’t know why but my previous question on this subject got rejected by the answer moderators. But ok so i have these little flat Cubes that are turret spawn points.
When a spawnpoint is clicked it will open a GUI menu to either spawn a turret, or delete one, the turret will spawn on the transform of an empty game object positioned rigt on top of the spawnpoint, but the problem is when the spawnpoint gets in the sphere collider of my turret the OnMouseDown function stops working and no Gui menu opens.
Here is the SpawnPoint script:

#pragma strict

var showGUI = false;
var turretExists = false;
var turretType = "";
var turretName = "";
var laserTurret : GameObject;
var spawnPoint1 : GameObject;
var spawnPoint2 : GameObject;
var spawnPoint3 : GameObject;
var spawnPoint4 : GameObject;
var spawnPoint5 : GameObject;
var spawnPoint6 : GameObject;
var spawnPoint7 : GameObject;
var spawnPoint8 : GameObject;

function OnMouseDown()
{
	if(showGUI == true)
	{
		showGUI = false;
	}
	else
	{
		showGUI = true;
	}
}

function OnGUI()
{
	if(showGUI == true)
	{
		transform.renderer.material.color = Color.green;
	 	GUILayout.BeginArea(new Rect(0, 0, Screen.width, Screen.height));
		GUILayout.FlexibleSpace();
		GUILayout.BeginHorizontal();
		GUILayout.FlexibleSpace();
		if(turretExists == false)
		{
			if(GUILayout.Button("Buy laser turret"))
			{
				SpawnLaserTurret();
				turretExists = true;
				turretType = "Laser Turret";
				showGUI = false;
				transform.renderer.material.color = Color.white;
			}
		}
		if(turretExists == true)
		{
			if(GUILayout.Button("Remove " + turretType))
			{
				if(turretType == "Laser Turret")
				{
					Destroy(GameObject.Find(turretName));
					turretExists = false;
					turretType = "";
					turretName = "";
					showGUI = false;
					transform.renderer.material.color = Color.white;
				}
			}
		}
		if(GUILayout.Button("Close"))
		{
			showGUI = false;
			transform.renderer.material.color = Color.white;
		}
		GUILayout.FlexibleSpace();
		GUILayout.EndHorizontal();
		GUILayout.FlexibleSpace();
		GUILayout.EndArea();
	}
}

function SpawnLaserTurret()
{
	if(transform.name == "SpawnPoint1")
	{
		var turret = Instantiate(laserTurret, spawnPoint1.transform.position, Quaternion.identity);
		turret.name = "Test's Laser Turret1";
		turretName = "Test's Laser Turret1";
	}
	if(transform.name == "SpawnPoint2")
	{
		var turret2 = Instantiate(laserTurret, spawnPoint2.transform.position, Quaternion.identity);
		turret2.name = "Test's Laser Turret2";
		turretName = "Test's Laser Turret2";
	}
	if(transform.name == "SpawnPoint3")
	{
		var turret3 = Instantiate(laserTurret, spawnPoint3.transform.position, Quaternion.identity);
		turret3.name = "Test's Laser Turret3";
		turretName = "Test's Laser Turret3";
	}
	if(transform.name == "SpawnPoint4")
	{
		var turret4 = Instantiate(laserTurret, spawnPoint4.transform.position, Quaternion.identity);
		turret4.name = "Test's Laser Turret4";
		turretName = "Test's Laser Turret4";
	}
	if(transform.name == "SpawnPoint5")
	{
		var turret5 = Instantiate(laserTurret, spawnPoint5.transform.position, Quaternion.identity);
		turret5.name = "Test's Laser Turret5";
		turretName = "Test's Laser Turret5";
	}
	if(transform.name == "SpawnPoint6")
	{
		var turret6 = Instantiate(laserTurret, spawnPoint6.transform.position, Quaternion.identity);
		turret6.name = "Test's Laser Turret6";
		turretName = "Test's Laser Turret6";
	}
	if(transform.name == "SpawnPoint7")
	{
		var turret7 = Instantiate(laserTurret, spawnPoint7.transform.position, Quaternion.identity);
		turret7.name = "Test's Laser Turret7";
		turretName = "Test's Laser Turret7";
	}
	if(transform.name == "SpawnPoint8")
	{
		var turret8 = Instantiate(laserTurret, spawnPoint8.transform.position, Quaternion.identity);
		turret8.name = "Test's Laser Turret8";
		turretName = "Test's Laser Turret8";
	}
}

And here is the turret script:

#pragma strict

var projectile : GameObject;
private var nextFireTime : float;
var delay : float;
var bulletApparitionPoint : Transform;

function OnTriggerStay(object : Collider)
{
	if(object.name == "Enemy")
	{
		transform.LookAt(object.transform.position);
		
		if(Time.time > nextFireTime)
		{
			ShootAtTarget();
			nextFireTime = Time.time + delay;
		}
	}
}

function ShootAtTarget()
{
	Instantiate(projectile, bulletApparitionPoint.position, bulletApparitionPoint.rotation);
}

Sorry, didn’t notice you weren’t using a mouse-informed ray to select objects. I would think that is the preferred method whenever a scene is complex enough to encounter this problem.

Use a raycast with this ray:
Camera.ScreenPointToRay(Input.mousePosition), filter out which objects are selectable using a layermask, and determine their priority when overlapping by sorting the results of RaycastAll();