getting a error with a switch statement

i’m trying to make a switch statement but i’m getting 3 error lines on 1 line of code, the error’s say
“operator ‘==’ cannot be used with a left hand side of type ‘system.type’ and a right hand side of type ‘PlayerState’. (BCE0051)” i’m new to coding so i havent got a clue, any help would be much appriciated`

enum PlayerState
{
	schaaplinks = 0,

	schaaprechts = 1,

	schaaplinksspring = 2,

	schaaprechtsspring = 3,
}

var playerState = PlayerState.schaaplinks;	

var lives     : int = 3;

var key                      : int = 0;

var coins : int = 0;

var projectiellazer : GameObject;

var projectielslotlinks : Transform;

var projectielslotrechts  : Transform;

var schaaplinks : Material;

var schaaprechts  : Material;

var veranderschaap : boolean = false;

var kijktlinks : boolean = false;

private var coinlive : int = 20;

private var canshoot : boolean = false;

function Update ()

{}

function Addkeys ( numkey : int )
{
	key += numkey;
}
function Addcoins ( numcoins : int )
{
    coins = coins + numcoins;	
}
function setPlayerState ()
{
	var playerControls = GetComponent ( "playerControls" );
	var charController = GetComponent ( CharacterController );
	switch  ( PlayerState )
		{
		case PlayerState.schaaplinks :
			break;
		case PlayerState.shaaprechts :
			break;
		case PlayerState.schaaplinksspring :
			break;
		case PlayerState.schaaprechtsspring :
			break;

PlayerState (upper case ‘P’) is an enumerated type. The variable you want to use in your switch statement is playerState (lowercase ‘p’).

You use the Enum Type as variable in the switch statement, instead of the variable of the type PlayerState.

switch(playerState) {
    //....
}

and not

switch(PlayerState) {
    //....
}

Also, please format your code properly on future posts. An unformatted script is nigh illegible.