Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

(Solved)Why can not I assign the BoolValue to disable a script in ServerServiceScript?

Hello, I am trying to disable a script of ServerServiceScript, the 2 scripts are in ServerServiceScript, in line 50, I am trying to assign the script to disable, with the BoolValue that is in Players / Stats / BoolValue, that instance in the script, that I want that disable the other script, I hope a solution, please. Thank you.

https://pastebin.com/i3QUJjdG

1 answer

✓ Accepted answer

From the Dev...

Scripts and LocalScripts, when parented to a valid parent, will run when Disabled is false. If Disabled is set to true whilst a script is running, the current thread will be terminated. If Disabled is set to true from false, the script will run again. This means the Disabled property can be toggled to restart a script:

scriptObject.Disabled = false
scriptObject.Disabled = true

The “bool” is the “disabled” property.

Note, the above code snippet cannot be used within the script itself. This is because once the script is disabled the thread will terminate.

If you’re trying to change a value from one script to another, you can do it through bindable events/remote events etc.

2 comments

0

Thamk you

0

Can you please give credit to whoever wrote this answer. This is the third time you don't give credits.

This discussion is preserved as it was. New answers, comments, and votes are closed.