Turn off a script and then back on?

I need to turn off a script in my game and then turn it back on. Pretty much the point is here:
I got ToggleCursor.cs
I need to turn off MouseLook.cs
Someone help me! :smiley:

You need to find the game object the script is on, either by tag, or by name, or by someone mechanism. Assuming it is on the camera:

  Camera.main.gameObject.GetComponent<MouseLook>().enabled = false;

Create a new script and paste this in there.

bool disableScript;
public scriptYouWantToStop scriptYouWantToStop;

bool disableScript;
public scriptYouWantToStop scriptYouWantToStop;

void Update
{
    if(disableScript)
    {
        startCourtine(pauseScript());
    }
}
ienumberable pauseScript();
{
    scriptYouWantToStop.enabled = false;
    yield return new waitforsecound(5);
}

This is untested and probably has some spelling errors. Just drag the script you want to pause into the variable scriptYouWantToStop in the inspector. (It is easier if this script is on the same GameObject).

GoodLuck!

public GameObject scripttodisable = GameObject.Find(“LevelNo”).GetComponent();
scripttodisable.setactive(false);`
Or
GameObject.Find(“LevelNo”).GetComponent().enabled=false;

LevelNo is the object which contains the script