PlayerControl

#pragma strict

private var hasAxe : boolean = false;

private var canSwing : boolean = true;
private var isSwinging : boolean = false;
var swingTimer : float = 0.7;

private var controller : CharacterController;
private var playerGUI : PlayerGUI;

function Start()
{
	hasAxe = true;
	controller = controller.GetComponent(CharacterController);
	playerGUI = playerGUI.GetComponent(PlayerGUI);
}

function Update()
{
	//If we aren't moving and if we aren't swinging, then we idle!
	
	if(controller.velocity.magnitude <= 0 && isSwinging == false)
	{
		GetComponent.<Animation>().Play("Idle");
		GetComponent.<Animation>()["Idle"].wrapMode = WrapMode.Loop;
		GetComponent.<Animation>()["Idle"].speed = 0.2;
	}
	
	//If we're holding shift and moving, then sprint!
	
	if(controller.velocity.magnitude > 0 && Input.GetKey(KeyCode.LeftShift))
	{
		GetComponent.<Animation>().Play("Sprint");
		GetComponent.<Animation>()["Sprint"].wrapMode = WrapMode.Loop;
	}
	
	//WOODCUTTING SECTION
	if(hasAxe == true && canSwing == true)
	{
		if(Input.GetMouseButtonDown(0))
		{
			//Stamina reduction applied to the PlayerGUI script
			playerGUI.staminaBarDisplay -= 0.1;
			
			//Swinging animation
			GetComponent.<Animation>().Play("Swing");
			GetComponent.<Animation>()["Swing"].speed = 2;
			isSwinging = true;
			canSwing = false;
		}
	}
	
	if(canSwing == false)
	{
		swingTimer -= Time.deltaTime;
	}
	
	if(swingTimer <= 0)
	{
		swingTimer = 1;
		canSwing = true;
		isSwinging = false;
	}
}

i get this error:
NullReferenceException: Object reference not set to an instance of an object
PlayerControl.Start () (at Assets/Scripts/PlayerControl.js:15)

NullReferenceException: Object reference not set to an instance of an object
PlayerControl.Update () (at Assets/Scripts/PlayerControl.js:23)

what i need to do?

I reformatted your code.
My guess is, that your NullReferenceExceptions are coming from the controller being NULL. That means that the script is not attached to a gameobject with CharacterController on it.