Disable and enable script

sir can anyone know how to DISABLE AND ENABLE SCRIPT? using gui button thanks and more power! :slight_smile:

You have a couple of options, the easiest way is to use booleans and encapsulate the script.

var show : boolean = true;

function OnGUI () {
    if (show) {
        //Code for button here
    }
}

You could also disable the script component from another script. When you disable a script component the script wont run at all (so enabling again has to be done from another component).

var objectWithScript : GameObject;

function DisableScript () {
    objectWithScript.GetComponent(ScriptName).enabled = false;
}

Also make sure to search before you post a question, there's plenty information out there about how to work with components.