script on monster checks if bool on attacking player = true?

I’m creating a melee system that works but I need to redo it so I can use it online if it ever gets there. What I think I need to do is, on the monster, on triggerenter, get the player thats doing the attack and check a variable on him. Say, isAttacking = true. Then if its true do the rest. I’m wondering is this possible? Heres my example code atm that i’m trying to convert to that idea.

—Attached to enemy—

static var swordReady : boolean = false;

function Start () {

}

function Update () {

}

function OnTriggerEnter (col : Collider)

{
	if(swordReady == true)
	{
	if(col.tag == "Weapon")
	{
	EnemyLogic.Enemy_Health -= 25;
	print(EnemyLogic.Enemy_Health);
	swordReady = false;
	}
}

}

---Attached to Player---

#pragma strict
function Start () {
 
}
 
function Update ()
{
    if (Input.GetButtonDown("Fire1"))
    {
        Enemy_Attacked.swordReady = true;
        animation.Play("Attack");
        animation["Attack"].wrapMode = WrapMode.Once;
    }
}

This appears to be nothing more than a question about how to get/set a variable on Script B from Script A, for which there are a ton of resources.

Try this
http://unitygems.com/script-interaction-tutorial-getcomponent-unityscript/

I just realized I need to reference to instances and call them locally and not globally like it is doing now.