BCE0023 No appropriate Version of UnityEngine.GameObject.GetComponent

This is the full Error Message:

Assets/guiHUD.js(59,59): BCE0023: No appropriate version of ‘UnityEngine.GameObject.GetComponent’ for the argument list ‘(UnityEngine.GameObject)’ was found.

Basically creating a simple game and the section i’m trying to code uses another script to reference from (PlayerDataScript) in this script it holds information for players name, score, items picked up etc. What i’m trying to do in my other script “GUIhud” is first create a HUD but secondly show the players name score and items picked up etc. Basically keep getting the same error for 4 similar lines of code which are basically 4 blocks which refer to going back and looking at the PlayerDataScript and returning the answer. This is a screen shot of the code that is wrong.[17787-screen+shot+2013-11-11+at+21.02.18.png|17787]

This is the kind of trouble you get into not following the lowercase-for-variables, uppercase-for-scripts convention.

Rename PlayerDataScript and the error will go away.

Example:

var pds : PlayerDataScript = playerData.GetComponent.< PlayerDataScript >();

(I usually use the “generic” version of GetComponent (with the angle brackets) because it always returns the proper type instead of just type Component.)

What you did in the original script is just as bad as having a transform variable named “Transform”.

my problem is Assets/AmmoBox.js(10,51): BCE0023: No appropriate version of ‘UnityEngine.GameObject.GetComponent’ for the argument list ‘(UnityEngine.GameObject)’ was found.

my script is :
#pragma strict

var ammo : int = 30;
var eject : GameObject;

private var shoteject : eject;
private var showGUI : boolean = false;

function Start () {
shoteject = GameObject.Find(“eject”).GetComponent (eject);
}

function Update () {
if(showGUI == true){
if(Input.GetKeyDown(“e”)){
shoteject.reserve += ammo;
Destroy (gameObject);
}
}
}

function OnTriggerEnter(hit : Collider){

if(hit.gameObject.tag == “Player”){
showGUI = true;
}
}

function OnTriggerExit(hit : Collider){

if(hit.gameObject.tag == “Player”){
showGUI = false;

}
}

function OnGUI(){

if(showGUI == true){
GUI.Box(Rect(Screen.width/2-100,Screen.height/2-12.5,200,25), “Press E to pickup ammo”);
}
}