Skip to main content

Action

Contains functions for common actions an Entity can perform.

info

This module can only be used in Entity scripts.

Properties​

isOn​

Returns whether the Entity is in the 'on' state. This property is read-only.

Functions​

turnOn()​

Switches the Entity to the 'on' state.

Example​

Permanently activate floor spikes after 2 seconds.

function onStart()
Action.turnOff()
Task.wait(2)
Action.turnOn()
end

turnOff()​

Switches the Entity to the 'off' state.

Example​

Turn on and off floor spikes every 1 second.

function onStart()
Action.turnOff()
while true do
Task.wait(1)
Action.turnOn()
Task.wait(1)
Action.turnOff()
end
end

reset()​

Resets the state of the Entity.

Example​

Turn off the entity and reset its state after 1 second.

function onStart()
Action.turnOff()
Task.wait(1)
Action.reset()
end