Can someone change this script to toggle?

Hey
I,m having trouble changing this script to a toggle instead of holding the input down. Can someone write this for me?

Here,s the script:

var aimTexture : GUITexture;
function Update() {
    // Only enable aim texture when 'SwitchWeapons' button is not pressed.
    // In this case I have used 'Shift' key for this.
    if (Input.GetButton("SwitchWeapons"))
        aimTexture.enabled = true;
    else
        aimTexture.enabled = false;
}

Sorry for the trouble, but I just started with scripting.

I’m not quite sure if that’s exactly what you want, but i assume you meant something like:

var aimTexture : GUITexture;
function Update() {
    if (Input.GetButtonDown("SwitchWeapons"))
        aimTexture.enabled = !aimTexture.enabled;
}

You could also use the ‘GetButtonUp’ version, that’s up to your desire.