Spawner
Makes copies of a template on a timer, on top of the part it’s in (they go when it stops).
- Inherits: Behavior → Instance
- Creatable: Yes:
new Spawner(), orInstance.new('Spawner', parent). - Replication: Server only: it, and everything inside it, is never sent to clients.
Makes copies of a template on a timer, on top of the part it’s in. The copies are its own: when it stops (removed, turned off), they go too.
Properties
Section titled “Properties”template
Section titled “template”Type: Instance | null · Default: null · Access: read/write · Replicates: no
What it copies: a part or model, often kept in ServerStorage.
interval
Section titled “interval”Type: number · Default: 5 · Range: 0 to 3,600 (clamped) · Access: read/write · Replicates: no
Seconds between copies (0 = only when it is set off).
Type: number · Default: 10 · Range: 0 to 50 (clamped) · Access: read/write · Replicates: no
Most copies alive at once (50 at most).
radius
Section titled “radius”Type: number · Default: 0 · Range: 0 to 1,000 (clamped) · Access: read/write · Replicates: no
Copies land within this many studs of its middle (0 = right on it).
lifetime
Section titled “lifetime”Type: number · Default: 0 · Range: 0 to 86,400 (clamped) · Access: read/write · Replicates: no
Seconds each copy lasts (0 = until something removes it).
Inherited from Behavior: enabled, running
Inherited from Instance: name, archivable, id, className, parent, destroyed
Methods
Section titled “Methods”getCopies
Section titled “getCopies”getCopies(): Instance[]Its copies that are still in the game.
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