Pickup Counter script

I have this script on my pickup ( a banana )

var targetObj : GameObject;

function OnTriggerEnter()

    {   

        var bananacount = targetObj.GetComponent(bananacount);

        bananacount.money++;
        audio.Play();
        Destroy(gameObject);
    }

and this on my main char.

var moneydisp : GUIText;
var money : int;

function Update () 
{

    moneydisp.text = "Bananas : " + money;
}

It's supposed to add one to the counter every time the trigger is entered, but in the banana script it won't let me add to the score using money++ or money = money + 1 at all, and i get an error of 'Expression Cannot be assigned to'. How can i get this to work 'right'?

Try making money static.

static var money: int;

With this, you don't need to call a GetComponent(bananacount), just

 bananacount.money++;