Trigger
A button: touching the part it’s in sets off, turns on, turns off or toggles behaviors elsewhere.
- Inherits: Behavior → Instance
- Creatable: Yes:
new Trigger(), orInstance.new('Trigger', parent). - Replication: Server only: it, and everything inside it, is never sent to clients.
A button: touching the part it’s in sets off, turns on, turns off or toggles behaviors.
Properties
Section titled “Properties”target
Section titled “target”Type: Instance | null · Default: null · Access: read/write · Replicates: no
What it acts on: a behavior, or a part, model or folder; then every behavior inside it.
action
Section titled “action”Type: 'activate' | 'enable' | 'disable' | 'toggle' · Default: 'activate' · Access: read/write · Replicates: no
activate sets them off (a Door opens, a Spawner makes a copy); enable, disable and toggle turn them on and off.
cooldown
Section titled “cooldown”Type: number · Default: 1 · Range: 0 to 60 (clamped) · Access: read/write · Replicates: no
Seconds before the same player can set it off again.
Inherited from Behavior: enabled, running
Inherited from Instance: name, archivable, id, className, parent, destroyed
Methods
Section titled “Methods”Inherited from Behavior: activate
Inherited from Instance: getPropertyChangedSignal, setAttribute, getAttribute, getAttributes, getAttributeChangedSignal, getChildren, getDescendants, findFirstChild, findFirstChildOfClass, findFirstChildWhichIsA, findFirstAncestor, findFirstAncestorWhichIsA, waitForChild, isA, isDescendantOf, isAncestorOf, getFullName, clearAllChildren, destroy, clone, toString
Events
Section titled “Events”Inherited from Instance: changed, childAdded, childRemoved, descendantAdded, descendantRemoving, ancestryChanged, destroying, attributeChanged