Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my script runnig even tho it disabled?

Asked by 3 years ago

So im am currently making a simulator game, and i made a settings menu that has an option to turn selling power to "Off" but the sellplace script is still running even tho it says its disabled.The script that detects the mouse click is a localscrip but its disabling the normal script in my sellplace.

0
uh what script do? you could use a debounce instead if you are going to enable it again. BulletproofVast 1033 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

If there is a script that is forcing another script to be disabled, it may not work.

try creating a BoolValue in workspace and name it Disabled, and put this into your script u want to disable:

if game.Workspace.Disabled == false then
    --your scripts here
else
    repeat
        wait(0.1)
    until game.Workspace.Disabled == false
end

The script that is attempting to "disable" the other script should checkmark or uncheck the BoolValue. Disable the script:

game.Workspace.Disabled = true

Enable the script:

game.Workspace.Disabled = false
Ad

Answer this question