Errors when using multiple if's in a statement.

Hi, I’m making a 2D game in which you play as a young girl fighting away ghosts. I’ve been toying with this code for a while, and I can’t seem to make it work. The aim of the code is to move the ghost away from the character, making them fly away from the girl making sure that the ghost is close enough to the player.

static var Distance : float;
static var Direction : int;
static var WhichSide : String;


//ASSIGNS VALUES TO VARIABLES, 
function Update () {
	Distance = (Insanity.dist); //Any given distance, usually between 1 & 5
	Direction = (MaterialChanger.CurrentDirection); // 1= Left 2=Right
	WhichSide = (Insanity.CurrentSide); //"Left" or "Right" 
	
//CHECKS IS VALUES ARE VIABLE FOR PLAYER ATTACK
if (Input.GetKeyDown(KeyCode.Attack1))
{
	if ((Distance < 1) && 
	   (Direction = 1) && 
	   (WhichSide = "Left")) 
	   {
	   LeftAttack();
	   }
	
	if ((Distance < 1) && 
	   (Direction = 2) && 
	   (WhichSide = "Right")) 
	   {
	   RightAttack();
	   }
}
}

//EXECUTES LEFT ATTACK
function LeftAttack()
{
		rigidbody.AddForce (-1, 0.5, 0);
	//print ("LEFT ATTACK ACHIEVED!");
} 

function RightAttack()
{
		rigidbody.AddForce (1, 0.5, 0);
	//print ("RIGHT ATTACK ACHIEVED!");
}

Here are the errors;

Assets/Attacking.js(16,23): BCE0044: expecting ), found ‘=’.
Assets/Attacking.js(16,25): BCE0044: expecting ), found ‘1’.
Assets/Attacking.js(16,26): BCE0043: Unexpected token: ).
Assets/Attacking.js(17,23): BCE0044: expecting ), found ‘=’.
Assets/Attacking.js(17,24): UCE0001: ‘;’ expected. Insert a semicolon at the end.
Assets/Attacking.js(17,25): BCE0043: Unexpected token: Left.
Assets/Attacking.js(19,24): BCE0044: expecting :, found ‘;’.

I’m probably wrong, but I don’t feel as though the errors displayed match the problems with the code.

Any help is much appreciated, thanks in advance!

Usually the first error is the most accurate, and then everything goes downhill from there. One issue that jumps out is that you are not using ‘==’ for comparison on lines 16, 17, 23 and 24. A single ‘=’ is used for assignment.