draw weapon animation

Hello, I want my player to draw a weapon, which i managed. But there’s a problem with my booleans when i’m trying to make him draw back his weapon. It’s seems the boolean doesn’t want to switch. The console is not telling anything, there be somethin wrong with logic ^^. Here’s the script

var sword : GameObject;

var weaponOut : boolean = true;

function Update () {

	if (Input.GetKeyDown(KeyCode.L)){
		Draw();
	}
}

function Draw() {

if (!weaponOut) {
	animation.Play("drawSword");
	weaponOut = true;
	
	yield WaitForSeconds(0.4);
	sword.active = true;
	}

if (weaponOut) {
	animation.Play("drawBackSword");
	weaponOut = false;

	yield WaitForSeconds(0.4);
	sword.active = false;
	}
	
}

First of all you don’t need to use all that code to make weapon swithing, here use this script!!
#pragma strict

var Weapon01 : GameObject;
var Weapon02 : GameObject;

function Update () {
	if (Input.GetKeyDown(KeyCode.Q))
	{
		SwapWeapons();
	}
}

function SwapWeapons()
{
	if (Weapon01.active == true)
	{
		Weapon01.SetActiveRecursively(false);
		Weapon02.SetActiveRecursively(true);
	}
	else 
	{
		Weapon01.SetActiveRecursively(true);
		Weapon02.SetActiveRecursively(false);
	}
}

Once you have all that Attach this script to your gun!!

function Update () {
 
    if (Input.GetKeyDown(KeyCode.Q)){
     animation.Play("drawSword");
    }

Subscribe to me: www.youtube.ca/boubalishgames