help with trigger

I have a sphere ontop of my character, and I want for whenever the sphere collides with something while the player is crouching, the player cannot stand up, so I have a variable called abletostand. What I have is when ctrl is released and abletostand = 1, then he stands up, but whenever abletostand = 0, he cant. So I have two functions to change abletostand to 0 and to 1, located below.

function OnTriggerStay (other : Collider) {
abletostand = 0;

}

function OnTriggerExit (other : Collider) {
abletostand = 1;

}

I found that the issue is with this code, as it is not registering or something.

Should it not work as, when the sphere comes in contact with something, abletostand goes to 0, and when it exits something, abletostand goes to 1?

What part of the code is working and what part is not working?

Just as a side note, I'd use ray casting here because trigger sensors tend to get messy with time (see example scenario at the end). Here's how I would approach this (parts of code taken from Unity script reference):

function AbleToStand()
{
    var hits : RaycastHit[];
    hits = Physics.RaycastAll (transform.position, transform.up, 5.0);

    for (var i = 0;i < hits.Length; i++) {
        var hit : RaycastHit = hits*;*
 *var hitRigidBody = hit.collider.attachedRigidBody;*
 *if (hitRigidBody) {*
 *// if(hitRigidBody.CompareTag("WorldGeometry"))*
 *return false; // Is not able to stand*
 *}*
 *}*
 *return true; // Is able to stand*
*} // Not tested!*
*```*
*<p><em>Example scenario using the triggers:</em></p>*
*<p><em>You are climbing under a bunch of adjacent crates. You get under the first crate -- OnTriggerStay is called -- you move forward and are passing the second crate -- OnTriggerExit gets called (for the first crate) -- your character may be able to stand for one frame, even when he shouldn't be. OnTriggerStay isn't guaranteed to be called each frame, either.</em> </p>*