Skip to content

Component Script

Berke edited this page Jun 23, 2026 · 1 revision

Script

The Script component represents a Lua script instance attached to an entity. It controls execution state and script source.


Properties

isValid

script.isValid

Returns whether the script component is valid.

Returns

boolean

fileName

script.fileName

Gets or sets the script file attached to the entity.

Type

string

Example

script.fileName = "player.lua"

enabled

script.enabled

Enables or disables script execution.

Type

boolean

Example

script.enabled = false

Example Usage

local script = entity.script

script.enabled = true
script.fileName = "enemy_ai.lua"

Clone this wiki locally