Skip to content
AEOWUN
Docs Menu

Script

Look up script calls and properties.

script.enable(path)

Enable script execution.

Arguments

path: project-relative string including scripts/ or playerscripts/ and .aeo.

Returns

nil.

Works with

Script files in the active project.

Missing values and errors

Wrong argument counts or types report an error.

Also available as: enable_script.

debug.log(script.enable("scripts/example.aeo"))

script.disable(path)

Stop script execution and cancel its active work.

Arguments

path: project-relative string including scripts/ or playerscripts/ and .aeo.

Returns

nil.

Works with

Script files in the active project.

Missing values and errors

Wrong argument counts or types report an error. Owned dynamic callbacks are removed. The file and saved binding remain.

Also available as: disable_script.

debug.log(script.disable("scripts/example.aeo"))

script.is_enabled(path)

Check whether a script is enabled.

Arguments

path: project-relative string including scripts/ or playerscripts/ and .aeo.

Returns

bool.

Works with

Script files in the active project.

Missing values and errors

Wrong argument counts or types report an error.

Also available as: is_script_enabled.

debug.log(script.is_enabled("scripts/example.aeo"))

task.spawn(callback) [BETA]

Schedule a function on the script scheduler.

Arguments

A function and optional callback arguments.

Returns

nil.

Works with

The current script scheduler.

Missing values and errors

Callback must be a function; delay must be valid.

task.spawn(fn() { debug.log("Started") })

task.defer(callback) [BETA]

Run a function in a later scheduler step.

Arguments

A function and optional callback arguments.

Returns

nil.

Works with

The current script scheduler.

Missing values and errors

Callback must be a function; delay must be valid.

task.defer(fn() { debug.log("Deferred") })

task.delay(seconds, callback) [BETA]

Schedule a function after a delay.

Arguments

Nonnegative finite seconds, function, optional callback arguments.

Returns

nil.

Works with

The current script scheduler.

Missing values and errors

Callback must be a function; delay must be valid.

task.delay(2, fn() { debug.log("Ready") })

engine.tweens.create(options) [BETA]

Animate a writable number or vector property over time.

Arguments

Options map containing target, property, endValue, time, and optional easing.

Returns

nil.

Works with

Writable Actor, Cell, Light, Sound, UI, or Material-layer properties.

Missing values and errors

Invalid target, property, or tween options raise errors.

engine.tweens.create({target: actor, property: "position", endValue: [2, 0, 0], time: 1})