Collectible
Picked up on touch (a coin, a gem): adds to the player’s stat, hides, and comes back later.
- Inherits: Behavior → Instance
- Creatable: Yes:
new Collectible(), orInstance.new('Collectible', parent). - Replication: Server only: it, and everything inside it, is never sent to clients.
Picked up on touch: adds to the player’s stat, hides, and comes back later.
Properties
Section titled “Properties”Type: string · Default: 'Coins' · Access: read/write · Replicates: no
The player’s stat it adds to (made if they don’t have it; ‘’ adds nothing).
amount
Section titled “amount”Type: number · Default: 1 · Access: read/write · Replicates: no
How much it adds (negative takes away).
respawn
Section titled “respawn”Type: number · Default: 10 · Range: 0 to 86,400 (clamped) · Access: read/write · Replicates: no
Seconds until it comes back (0 = it can be picked up only once).
collected
Section titled “collected”Type: boolean · Access: read-only
True while it’s picked up and hidden.
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