Class · inherits LuaSourceContainer
BaseScript
The base class for all script objects which run automatically.
About BaseScript
The base class for all script objects which run automatically.
Properties 3
Disabled
: booleanDetermines whether aBaseScriptruns or not.Determines whether a
BaseScriptruns or not.Setting this property to true while the script is running drops its references to the script's thread; a thread that is yielded (or that yields later) is never resumed and becomes eligible for garbage collection. A thread that is actively executing continues to run until it next yields or returns.
If this property is changed from true to false, a fresh run of the script is started. This means that
Disabledcan be toggled to restart a script.Enabled
: booleanNotReplicatedDetermines whether aBaseScriptruns or not.Determines whether a
BaseScriptruns or not. We recommend this property over the similar but oppositeDisabled.Setting this property to false while the script is running drops its references to the script's thread; a thread that is yielded (or that yields later) is never resumed and becomes eligible for garbage collection. A thread that is actively executing continues to run until it next yields or returns.
If this property is changed from false to true, a fresh run of the script is started. This means that
Enabledcan be toggled to restart a script.RunContext
: RunContextDetermines the context under which the script runs.Determines the context under which the script runs. Only available for
Scripts, notLocalScripts.When set to
Legacy,Scriptsonly run when parented to certain containers. See Script types and locations.If
RunContextis assigned while the script is running, the engine drops its references to that thread, and a fresh run of the script is started under the new context (if possible). A thread that is actively executing continues to run until it next yields or returns.
BaseScript also has every member of LuaSourceContainer. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.