Skip to content

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.

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.