Javascript GUI error

if the GUI is up when the player dies it stays up after respawn even though the player is out of the OnTriggerEnter for the GUI

#pragma strict

var theDoor : Transform;
private var doorIsClosed = true;
private var drawGUI = false;

function Update ()
{
    if (drawGUI == true && Input.GetKeyDown(KeyCode.F))
    {
        changeDoorState();
    }
}


function OnTriggerEnter (theCollider : Collider)
{
    if (theCollider.tag == "Player")
    {
        drawGUI = true;
    }
}

function OnTriggerExit (theCollider : Collider)
{
    if (theCollider.tag == "Player")
    {
        drawGUI = false;
    }
}

function OnGUI ()
{
    if (drawGUI == true)
    {
        GUI.Box (Rect (Screen.width*0.5-51, 400, 102, 22),"Press F to open");
    }

}

function changeDoorState ()
{
    if (doorIsClosed == true)
    {
        theDoor.animation.CrossFade("Door Open");
        //theDoor.audio.PlayOneShot();
        doorIsClosed = false;
        yield WaitForSeconds(3);
        theDoor.animation.CrossFade("Door Close");
        //theDoor.audio.PlayOneShot();
        doorIsClosed = true;
    }
}

I think OnTriggerExit only is called when the physical object moves through the colllider so maybe if its teleported it doesnt get called

how could I fix that?

Set drawGUI to false when you respawn the player…

how can I set that I’m new to scripting lol