Script¶
Inherits Instance
Scripts are abstract base classes representing Lua code that can be executed in the game.
Abstract Object
This object exists only to serve as a foundation for other objects. It cannot be accessed directly, but its properties are documented below.
Additionally, it cannot be created in the creator menu or with Instance.New().
Not newable
This object cannot be created by scripts using Instance.New().
Properties¶
Source : string¶
The source code of the script as a string.
IsEnabled : boolean¶
Determine if this script should be enabled. Note that setting it to false during runtime won't stop the script immediately, rather it would stop any running threads when it hits any yield function.
LinkedScript : FileLinkAsset¶
A linked script asset associated with this script.
Compatibility : boolean¶
Indicates whether the script is running in compatibility mode.
Methods¶
Call → nil¶
Parameters
funcName [ string ]
args [ any ]
Calls a function in the script with the given arguments.
CallAsync → nil¶
Parameters
funcName [ string ]
args [ any ]
Calls a function in the script asynchronously with the given arguments.
LinkWithScriptFile → nil¶
Parameters: scriptPath [ string ]
Link script with the target file path