Probably simple GUI script error.

I hope this is a simple problem to solve, but it seems to be the only scripting error I have at the moment and I’m not sure how to solve it.
It’s for a GUI script to show the amount of orbs the character has created but I get the error;

UnityException: You are not allowed to call this function when declaring a variable.
Move it to the line after without a variable declaration.
If you are using C# don't use this function in the constructor or field initializers, Instead move initialization to the Awake or Start function.

livesGui..ctor ()   (at Assets\Scripts\GUI\livesGui.js:4)

And this is the code;

var guiSkin: GUISkin;
var textFieldString = "text field"; 
var livesString = "Orbs:"; 
var scorecontrol : ThirdPersonStatus = GetComponent(ThirdPersonStatus);

function OnGUI () { 
   livesString = "" + scorecontrol.lives; 
   textFieldString = GUI.TextField (Rect (145, 125, 100, 30), livesString); 
}

I have tried to do what the error log told me to, but it hasn’t worked. Any help will be greatly appreciated.

You are not allowed to call GetComponent when declaring a variable. Try this:

var scoreControl : ThirdPersonStatus;

function Start () {
    scoreControl = GetComponent(ThirdPersonStatus);
}

That’s great, Peter G, thanks a lot for the help! It seems to have solved that problem.
Trouble is, is that now everytime I play the game the score control set to the third person status resets to “none”. Does anyone have any idea as to why this might be?

Never mind, I’ve figured it out now, I just had to apply the scripts to the character. Thanks, Peter G.