Destroy(gameObject); for one instance of an object? Any help would be nice :)

I’m trying to make a script that will destroy the object i click on. as long as it is with in a sertan range of the player.
I’ve gotten the range part down but when i click on one object it destroys all instances with in the range.
I need help isolating the script to destroying only the object i click on.

var target : Transform;
var com : Transform;
var range =10;
private var derp = 0;
 var hit : RaycastHit;


function Update(){

if (Vector3.Distance(target.position,com.position) > range){

return;}

	var mainCamera = FindCamera();
		print(FindCamera());
		
	// We need to actually hit an object
	
	if (!Physics.Raycast(mainCamera.ScreenPointToRay(Input.mousePosition),  hit, 100)){
		print("raycast"+!Physics.Raycast(mainCamera.ScreenPointToRay(Input.mousePosition),  hit, 100));

		return;}
		
		
	// We need to hit a rigidbody that is not kinematic
	if (!hit.rigidbody || hit.rigidbody.isKinematic){
	
	if (Input.GetMouseButtonDown (1)){
	Destroy(gameObject);
      return;}
      
	return;}
	  

		
}

	
	
function FindCamera ()
	{
		if (camera)
			return camera;
		else
			return Camera.main;
	}

I don’t know to which object you’re attaching this script, but you should attach this script to a single gameobject that handle the mouse click, then move the IF GETMOUSEBUTTON statement before raycast (so you save performance, it’s not needed to raycast if you didn’t click) and finally replace Destroy(gameObject) with Destroy(hit.transform.gameObject).

By the way, why are you checking the range when you can just pass range to raycast as distance?