error: namespace already contains definition

I keep getting a report saying Assets/Scripts/Ships/MissileLancher.js(9,6): BCE0132: The namespace ‘’ already contains a definition for ‘guntype’.

it has only one definition help?

var reloadtime : float;
var shot : GameObject;
var numshots : int;
var au : Object;
private var Target : GameObject;

enum guntype{
singlefire,
rapidfire,
}


function ChangeTarget(t : GameObject){
Target = t;
}



var gunType : guntype;

private var loaded : boolean = true;
private var fireing : boolean = false;
private var t : Transform;

function Start(){
t = transform;
au = audio;
}



function FireCheck(){
switch(gunType){
case guntype.singlefire:
	if (loaded){Fire();}
	break;
case guntype.rapidfire:
	if (loaded){Fire();}
	break;
}
}

function Fire(){
var s : GameObject;
switch(gunType){
case guntype.singlefire:
	s=Instantiate(shot,t.position,t.rotation);
	s.SendMessage("ChangeTarget",Target,SendMessageOptions.DontRequireReceiver);
	au.Play();
	loaded = false;
	yield WaitForSeconds(reloadtime);
	loaded = true;
	break;
case guntype.rapidfire:
	for (i=1;i < numshots; i++){
	s=Instantiate(shot,t.position,t.rotation);
	au.Play();
	yield WaitForSeconds(0.15);
	}
	loaded = false;
	yield WaitForSeconds(reloadtime);
	loaded = true;
	break;
}
}

thanks

I placed this script in my project, and had no errors. It seems you have another script (maybe an old version of this one) with guntype defined elsewhere in your project, and it’s causing the error. Both scripts probably are in the same folder - I tried this, and only had errors when both scripts were compiled together.

Problem Fixed here : The namespace already contains a definition for Unity - YouTube