Invalid IL code error when calling static function

I’m making a game where the player can fly via

static var jumpHeight = 8;

static function fly (){
	GetComponent.<Rigidbody>().velocity.y = jumpHeight;
}

which is being called by

if (Input.GetKey (KeyCode.Space))
	{
		if (MainScript.flying == true)
		{
			FlightScript.fly ();
		}	
	}

However, when I press space, I get an error reading:

InvalidProgramException: Invalid IL code in FlightScript:fly (): IL_0008: ldarg.0

I have absolutely no idea what this error means or what is causing it. All I know is that whatever is causing it is keeping my game from working. If anyone has any experience with this error please tell me how to fix it.

The problem is right there :

 static function fly (){
     GetComponent.<Rigidbody>().velocity.y = jumpHeight;
 }

This cannot work. fly is a static function, which means it is not associated to any instance of your script, therefore it is not associated to any GameObject in your scene.
GetComponent is not static, it needs a GameObject instance.

You need to actually retrieve a reference to the player character before you can get its rigidbody, or use a static instance and make your script a Singleton.

See this detailed answer if you need more information.