Is there a way to disable a script with a script, if so how?
How can I disable SC with a SC?
3 answers
Let's say that the scriptyou want to disabled is in the Workspace. And is called NeedsToBeDisabled, then simply do this code:
game.Workspace.NeedsToBeDisabled.Disabled = true
In other words every script has a [Disabled] property.
The Disabled property exists on all Script Instances, so as long as you can get an object path (like game.Workspace.YourScript) to the Script, then you can disable it!
game.Workspace.NameOfYourScript.Disabled = true
You can, of course, also disable a Script from inside itself using the script self-reference:
script.Disabled = true
If you want to re-enable it after that, set the Disabled property to false, this will reinitiate the script (from the start).
All scripts have a Disabled property.
Turn script on: game.Workspace.Script.Disabled = false
Turn script off: game.Workspace.Script.Disabled = true
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
o if it was a onClick with a wait time(say if I wanted the enable to happen 5 seconds after the disable) would it be like" game. Workspace.Nameofmyscript.Disable = true wait(5) game.Workspace.NameOfMySCript.Enable = true ?
Set disable to false, not enable to true.
GoldPhysics is right, there is no "Enabled" property on a Script, you ENABLE the script by setting DISABLED to FALSE, that is how booleans work, they are either on or off.