Swtich weapons problem (attach to bone)

I made a sword that need to be pull when I switching weapons. I used for that a code that attach the sword to the bone in the hand when a variable in the character’s code is true.
The problem is that the sword is always attached to the body’s bone and never change it (the sword should been attach to the body’s bone when I use another weapon, when I use the sword it should been attach to the hand’s bone). Is there any way to make the code works or there is a better way to pull out the swrod?

This is my code:

var target : Transform; 
 
 function Awake()
 {
     if (BobC.putSword)
	 {
		 target = GameObject.FindWithTag("Hand").transform;
	     transform.parent = target.transform;
	 }
	 
	 if (!BobC.putSword)
	 {
		 target = GameObject.FindWithTag("Body").transform;
	     transform.parent = target.transform;
	 }
 }

The code should work when in the withing animation. The sword have no rigidbody and no collider.

Sorry for poor english.

I solved the problem by myself (thnx to Owen Reynolds who sade “Awake only runs once”).
I made 2 swords: one attached to the hand and other to the body. With the fact that Awake runs only once I edited the code a bit and attached the code to every part of both swords and every sword attached to another bone from the beginning. in the code I just enabled and disable the renderer every time the variable is true of false (when the sword is been pull out the renderer is visible and when it pull in it not visible).

This is the body’s sword code:

var target : Transform; 
 
 function Awake ()
 {
	 target = GameObject.FindWithTag("Body").transform;
	 transform.parent = target.transform;
 }
 
 function Update ()
 {
     if (BobC.putSword)
	 {
	     renderer.enabled = false;
	 }
	 else
	 {
	     renderer.enabled = true;
	 }
 }

The hand’s sword have a similar code to the body’s sword but it attached to the hand and not the body and the renderer is visible when the other sword is not visible so it seems like I pull the sword and the sword is not just disappear.

Sorry for poor english.