i got this error 2 timeBCE0019:'enabled'is not a member 'UnityEngine.Component' please help!

Hey guys i got this error two times , the “UnityEngine.Component”
Assets/Resources/NewScripts/weaponManager .js(258,27): BCE0019: ‘enabled’ is not member of 'UnityEngine.Component".
Assets/Resources/NewScripts/weaponManager .js(280,19): BCE0019: ‘enabled’ is not member of 'UnityEngine.Component".
The Script:

var weaponsInUse : GameObject[];					// used weapons, among which you can switch.
var weaponsInGame : GameObject[];					// all weapons, which could be used in game 
var worldModels : Rigidbody[]; 						// just a prefab which could be instantiated when you drop weapon

var hit : RaycastHit;
var distance : float = 2.0;
var layerMaskWeapon : LayerMask;
var layerMaskAmmo : LayerMask;

var dropPosition : Transform;

var switchWeaponTime : float = 0.5;
@HideInInspector
var canSwitch : boolean = true;
@HideInInspector
var showWepGui : boolean = false;
@HideInInspector
var showAmmoGui : boolean = false;
private var equipped : boolean = false;
//@HideInInspector
//var i : int = 0;
//@HideInInspector
var weaponToSelect : int;
//@HideInInspector
var setElement : int;
//@HideInInspector
var weaponToDrop : int;
var mySkin : GUISkin;
var pickupSound : AudioClip;
private var textFromPickupScript : String = "";
private var notes : String = "";
private var note : String = "Press key <E> to pick up Ammo";
private var note2 : String = "Select appropriate weapon to pick up ammo";

function Start (){

weaponToSelect = 0;
DeselectWeapon();
}

function Update () {

if (Input.GetKeyDown("1") && weaponsInUse.length >= 1 && canSwitch && weaponToSelect != 0) {
    DeselectWeapon();
	weaponToSelect = 0;

} else if (Input.GetKeyDown("2") && weaponsInUse.length >= 2 && canSwitch && weaponToSelect != 1) {
	DeselectWeapon();
	weaponToSelect = 1;

}

if (Input.GetAxis("Mouse ScrollWheel") > 0 && canSwitch){
	    weaponToSelect++;
	if (weaponToSelect > (weaponsInUse.length - 1)){
	    weaponToSelect = 0;
	}
	DeselectWeapon();
}

if (Input.GetAxis("Mouse ScrollWheel") < 0 && canSwitch){
	weaponToSelect--;
	if (weaponToSelect < 0){
		weaponToSelect = weaponsInUse.length - 1;
	}
	DeselectWeapon();
}

var position = transform.parent.position;
var direction : Vector3 = transform.TransformDirection (Vector3.forward);
if (Physics.Raycast (position, direction, hit, distance, layerMaskWeapon.value)){

	var prefab : WeaponIndex = hit.transform.GetComponent("WeaponIndex");
	setElement = prefab.setWeapon;
	showWepGui = true;
																										//if you want more than 2 weapons equip at the same time		
	if(weaponsInUse[0] != weaponsInGame[setElement] && weaponsInUse[1] != weaponsInGame[setElement]){ //&& weaponsInUse[2] != weaponsInGame[setElement] && weaponsInUse[3] != weaponsInGame[setElement]){
		equipped = false;
	}else{
		equipped = true;
	}
	
	if(canSwitch){
		if(!equipped && Input.GetKeyDown ("e")){
			DropWeapon(weaponToDrop);
			DeselectWeapon();
			weaponsInUse[weaponToSelect] = weaponsInGame[setElement];
				if(setElement == 8){
					var pickupGOW1 : Pickup = hit.transform.GetComponent("Pickup");
					addStickGrenades(pickupGOW1.amount);
				}	
			Destroy(hit.collider.transform.parent.gameObject);
			
		}else{	
		
			if(setElement == 8){
				if(Input.GetKeyDown ("e")){
					var pickupGOW : Pickup = hit.transform.GetComponent("Pickup");
					addStickGrenades(pickupGOW.amount);
					Destroy(hit.collider.transform.parent.gameObject);
				}
			}
		}			
	}

}else{
	showWepGui = false;
}

if (Physics.Raycast (position, direction, hit, distance, layerMaskAmmo.value)){
	showAmmoGui = true;
	if(hit.transform.CompareTag("Ammo")){
		var pickupGO : Pickup = hit.transform.GetComponent("Pickup");
		
		//ammo for pistols, rifles 
		if (pickupGO.pickupType == PickupType.Magazines) {
			var mags : WeaponScriptNEW = weaponsInUse[weaponToSelect].gameObject.transform.GetComponent("WeaponScriptNEW");
			if(mags != null && mags.firstMode != fireMode.launcher){
				notes = "";
				textFromPickupScript = note;
				if(Input.GetKeyDown ("e")){
					if(mags.ammoMode == Ammo.Magazines){
						mags.magazines += pickupGO.amount;
					}else{
						mags.magazines += pickupGO.amount * mags.bulletsPerMag;
					}	
					audio.clip = pickupSound;
					audio.Play();	
					Destroy(hit.collider.gameObject);
				}	
			}else{
				textFromPickupScript = pickupGO.AmmoInfo;
				notes = note2;
			}
		}
		//ammo for Sniper rifle
		if (pickupGO.pickupType == PickupType.SniperMagazines) {
			var magsSniper : SniperScript = weaponsInUse[weaponToSelect].gameObject.transform.GetComponent("SniperScript");
			if(magsSniper != null){
				notes = "";
				textFromPickupScript = note;
				if(Input.GetKeyDown ("e")){
					magsSniper.magazines += pickupGO.amount;
					audio.clip = pickupSound;
					audio.Play();	
					Destroy(hit.collider.gameObject);
				}	
			}else{
				textFromPickupScript = pickupGO.AmmoInfo;
				notes = note2;
			}	
		}
		//ammo for weapon if second fireMode is luancher
		if (pickupGO.pickupType == PickupType.Projectiles) {
			var projectile : WeaponScriptNEW = weaponsInUse[weaponToSelect].gameObject.transform.GetComponent("WeaponScriptNEW");
			if(projectile != null && projectile.secondMode == fireMode.launcher){
				notes = "";
				textFromPickupScript = note;
				if(Input.GetKeyDown ("e")){
					projectile.projectiles += pickupGO.amount;
					audio.clip = pickupSound;
					audio.Play();	
					Destroy(hit.collider.gameObject);
				}	
			}else{
				textFromPickupScript = pickupGO.AmmoInfo;
				notes = note2;
			}
		}
		//ammo for rocket launcher
		if (pickupGO.pickupType == PickupType.Rockets) {
			var rockets : WeaponScriptNEW = weaponsInUse[weaponToSelect].gameObject.transform.GetComponent("WeaponScriptNEW");
			if(rockets != null && rockets.firstMode == fireMode.launcher){
				notes = "";
				textFromPickupScript = note;
				if(Input.GetKeyDown ("e")){
					rockets.projectiles += pickupGO.amount;
					rockets.EnableProjectileRenderer();
					audio.clip = pickupSound;
					audio.Play();	
					Destroy(hit.collider.gameObject);	
				}	
			}else{
				textFromPickupScript = pickupGO.AmmoInfo;
				notes = note2;
			}	
		}
		//ammo for shotgun
		if (pickupGO.pickupType == PickupType.Shells) {
			var bullets : ShotGunScriptNEW = weaponsInUse[weaponToSelect].gameObject.transform.GetComponent("ShotGunScriptNEW");
			if(bullets != null){
				notes = "";
				textFromPickupScript = note;
				
				if(Input.GetKeyDown ("e")){
					bullets.magazines += pickupGO.amount;
					audio.clip = pickupSound;
					audio.Play();	
					Destroy(hit.collider.gameObject);
				}
			}else{
				textFromPickupScript = pickupGO.AmmoInfo;
				notes = note2;
			}
		}
		//pickup health
		if (pickupGO.pickupType == PickupType.Health) {
			textFromPickupScript = pickupGO.AmmoInfo;
			notes = "";
			if(Input.GetKeyDown ("e")){
				var playerGO = GameObject.Find("Player"); 
				var health : PlayerDamageNew = playerGO.gameObject.transform.GetComponent("PlayerDamageNew");
				health.hitPoints += pickupGO.amount;
				audio.clip = pickupSound;
				audio.Play(); 	
				Destroy(hit.collider.gameObject);
			}
		}
	}	

}else{
	showAmmoGui = false;
}	
}

function addStickGrenades(amount : int){
yield WaitForSeconds(.5);
var stickGrenade : GrenadeScript = weaponsInGame[8].gameObject.transform.GetComponent("GrenadeScript");
stickGrenade.grenadeCount += amount;
stickGrenade.DrawWeapon();
}

function OnGUI(){
GUI.skin = mySkin;
var style1 = mySkin.customStyles[0];
if(showWepGui){
	if(!equipped){
		GUI.Label(Rect(Screen.width - (Screen.width/1.7),Screen.height - (Screen.height/1.4),800,100),"Press key << E >> to pickup weapon", style1);
	}else{	
		GUI.Label(Rect(Screen.width - (Screen.width/1.7),Screen.height - (Screen.height/1.4),800,100),"Weapon is already equipped");
	}
}

if(showAmmoGui){
	GUI.Label(Rect(Screen.width - (Screen.width/1.7),Screen.height - (Screen.height/1.4),800,200), notes + "

" + textFromPickupScript, style1);
}
}

function DeselectWeapon(){
//Dectivate all weapon
for (var i : int = 0; i < weaponsInUse.length; i++){
	weaponsInUse*.gameObject.SendMessage("Deselect", SendMessageOptions.DontRequireReceiver);*

_ var deactivate : Component = weaponsInUse*.gameObject.GetComponentsInChildren(MonoBehaviour);_
_
for (var d in deactivate) {_
_
var d : MonoBehaviour = d as MonoBehaviour;_
_
if (d)_
_
d.enabled = false;_
_
}_
_ weaponsInUse.gameObject.SetActiveRecursively(false);
}
Wait();
}
function Wait(){
canSwitch = false;
yield WaitForSeconds(switchWeaponTime);
SelectWeapon(weaponToSelect);
yield WaitForSeconds(switchWeaponTime);
canSwitch = true;
}
function SelectWeapon (i : int) {
//Activate selected weapon*
weaponsInUse*.gameObject.SetActiveRecursively(true);
var activate : Component[] = weaponsInUse.gameObject.GetComponentsInChildren(MonoBehaviour);
for (var a in activate) {
var a : MonoBehaviour = a as MonoBehaviour;
if (a)
a.enabled = true;
}
weaponsInUse.gameObject.SendMessage(“DrawWeapon”);
var temp : WeaponIndex = weaponsInUse.gameObject.transform.GetComponent(“WeaponIndex”);
weaponToDrop = temp.setWeapon;
}*

function DropWeapon(index : int){_

* for (var i : int = 0; i < worldModels.length; i++){*
* if (i == index){*
_ var drop : Rigidbody = Instantiate(worldModels*, dropPosition.transform.position, dropPosition.transform.rotation);
drop.AddRelativeForce(0,50,Random.Range(100, 200));
}
}
}*_

Well, the compiler output tells you the problem occurs on lines 258 and 280. When I copied and pasted your code example into a text editor to look at these lines, what I see is two occasions where you have a for loop and inside the loop you declare a variable with the same name:

for (var d in deactivate) {
   var d : MonoBehaviour = d as MonoBehaviour;
   if (d)
   d.enabled = false;
}

Maybe this is perfectly valid from a programming point of view. What Unity’s compiler is thinking is that the variable d from the for loop is a Component, and it’s ignoring the next line. So, when you access d.enabled, the compiler tells you (correctly) that a Component does not have an enabled member. I suspect if you change your code to be:

for (var d in deactivate) {
   var dd : MonoBehaviour = d as MonoBehaviour;
   if (dd)
   dd.enabled = false;
}

then you’ll make progress. You’ll want to change both times you do this (around line 258 and 280).