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

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

Asked by
brok4d 77
5 years ago
Edited 5 years ago

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

Log in to vote
1
Answered by
ABK2017 406 Moderation Voter
5 years ago
Edited 5 years ago

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.

0
Thamk you brok4d 77 — 5y
0
Can you please give credit to whoever wrote this answer. This is the third time you don't give credits. User#19524 175 — 5y
Ad

Answer this question