Skip to content

Behavior

Ready-made game logic: put it in the part or model it acts on and tune its settings.

Ready-made game logic: put one inside the part or model it acts on (game-wide ones anywhere in the Workspace or ServerScriptService) and tune its settings. A behavior starts when it’s enabled and in the Workspace, reacts to setting changes at once, and stops cleanly when it’s removed or disabled, putting back what it changed.

Type: boolean · Default: true · Access: read/write · Replicates: yes

Runs while true. Turning it off stops it and puts back what it changed.

Type: boolean · Access: read-only

True while it runs on this device (enabled, in the Workspace, and started by the game).

Inherited from Instance: name, archivable, id, className, parent, destroyed

activate(player?: Player | null): void

Does what this behavior does when something sets it off: a Trigger, or a script. player is who set it off, when there is someone (a Door checks their stats, a Teleporter sends them). Does nothing while it isn’t running (one that was just added starts first). What it starts belongs to the behavior, not to the script that called it.

Inherited from Instance: getPropertyChangedSignal, setAttribute, getAttribute, getAttributes, getAttributeChangedSignal, getChildren, getDescendants, findFirstChild, findFirstChildOfClass, findFirstChildWhichIsA, findFirstAncestor, findFirstAncestorWhichIsA, waitForChild, isA, isDescendantOf, isAncestorOf, getFullName, clearAllChildren, destroy, clone, toString

Inherited from Instance: changed, childAdded, childRemoved, descendantAdded, descendantRemoving, ancestryChanged, destroying, attributeChanged