Instance

extends Object

Class fields

FieldXML typeValue
NamestringInstance
Browsableboolfalse

Properties

8
Archivable
bool
FieldXML typeValue
NamestringArchivable
summarystringDetermines whether or not an Instance can be saved when the game closes/attempts to save the game. Note: this only applies to games that use Data Persistence, or Personal Build Servers.
AttributesSerialize
BinaryString
FieldXML typeValue
NamestringAttributesSerialize
Browsableboolfalse
summarystringInternal serialized custom attribute payload.
DataCost
int
FieldXML typeValue
NamestringDataCost
Browsableboolfalse
Name
string
FieldXML typeValue
NamestringName
Parent
Object
FieldXML typeValue
NamestringParent
summarystringThe Instance that is directly above this Instance in the tree.
RobloxLocked
bool
FieldXML typeValue
NamestringRobloxLocked
Browsableboolfalse
Tags
SharedString
FieldXML typeValue
NamestringTags
Browsableboolfalse
summarystringInternal serialized tag payload.
archivable
bool
FieldXML typeValue
Namestringarchivable

Functions

29
AddTag
(tag: string) → void
FieldXML typeValue
NamestringAddTag
summarystringAdds a tag to this instance.
ClearAllChildren
() → void
FieldXML typeValue
NamestringClearAllChildren
summarystringRemoves all children (but not this object) from the workspace.
Clone
() → Instance
FieldXML typeValue
NamestringClone
summarystringReturns a copy of this Object and all its children. The copy's Parent is nil
Destroy
() → void
FieldXML typeValue
NamestringDestroy
summarystringRemoves object and all of its children from the workspace. Disconnects object and all children from open connections. Object and children may not be usable after calling Destroy.
FindFirstChild
(name: string, recursive: bool = …) → Instance
FieldXML typeValue
NamestringFindFirstChild
summarystringReturns the first child of this Instance that matches the first argument 'name'. The second argument 'recursive' is an optional boolean (defaults to false) that will force the call to traverse down thru all of this Instance's descendants until it finds an object with a name that matches the 'name' argument. The function will return nil if no Instance is found.
FindFirstChildOfClass
(className: string) → Instance
FieldXML typeValue
NamestringFindFirstChildOfClass
FindFirstChildWhichIsA
(className: string, recursive: bool = …) → Instance
FieldXML typeValue
NamestringFindFirstChildWhichIsA
GetActor
() → Instance
FieldXML typeValue
NamestringGetActor
GetAttribute
(attribute: string) → Variant
FieldXML typeValue
NamestringGetAttribute
summarystringReturns the custom attribute with the given name, or nil.
GetAttributeChangedSignal
(attribute: string) → RBXScriptSignal
FieldXML typeValue
NamestringGetAttributeChangedSignal
summarystringReturns a signal for changes to the named custom attribute.
GetAttributes
() → Dictionary
FieldXML typeValue
NamestringGetAttributes
summarystringReturns a copy of this instance's custom attributes.
GetChildren
() → Objects
FieldXML typeValue
NamestringGetChildren
summarystringReturns a read-only table of this Object's children
GetDebugId
(scopeLength: int = …) → string
FieldXML typeValue
NamestringGetDebugId
Browsableboolfalse
summarystringThis function is for internal testing. Don't use in production code
GetDescendants
() → Objects
FieldXML typeValue
NamestringGetDescendants
summarystringReturns a read-only table of this Object's descendants
GetFullName
() → string
FieldXML typeValue
NamestringGetFullName
summarystringReturns a string that shows the path from the root node (DataModel) to this Instance. This string does not include the root node (DataModel).
GetTags
() → Array
FieldXML typeValue
NamestringGetTags
summarystringReturns this instance's tags in insertion order.
HasTag
(tag: string) → bool
FieldXML typeValue
NamestringHasTag
summarystringReturns whether this instance has a tag.
IsAncestorOf
(descendant: Instance) → bool
FieldXML typeValue
NamestringIsAncestorOf
IsDescendantOf
(ancestor: Instance) → bool
FieldXML typeValue
NamestringIsDescendantOf
Remove
() → void
FieldXML typeValue
NamestringRemove
summarystringDeprecated. Use ClearAllChildren() to get rid of all child objects, or Destroy() to invalidate this object and its descendants
Deprecatedbooltrue
RemoveTag
(tag: string) → void
FieldXML typeValue
NamestringRemoveTag
summarystringRemoves a tag from this instance.
SetAttribute
(attribute: string, value: Variant) → void
FieldXML typeValue
NamestringSetAttribute
summarystringSets a custom attribute, or removes it when value is nil.
children
() → Objects
FieldXML typeValue
Namestringchildren
Deprecatedbooltrue
summarystringUse GetChildren() instead
clone
() → Instance
FieldXML typeValue
Namestringclone
Deprecatedbooltrue
summarystringUse Clone() instead
destroy
() → void
FieldXML typeValue
Namestringdestroy
findFirstChild
(name: string, recursive: bool = …) → Instance
FieldXML typeValue
NamestringfindFirstChild
Deprecatedbooltrue
summarystringUse FindFirstChild() instead
getChildren
() → Objects
FieldXML typeValue
NamestringgetChildren
Deprecatedbooltrue
summarystringUse GetChildren() instead
isDescendantOf
(ancestor: Instance) → bool
FieldXML typeValue
NamestringisDescendantOf
remove
() → void
FieldXML typeValue
Namestringremove
Deprecatedbooltrue
summarystringUse Remove() instead

Yield functions

1
WaitForChild
(childName: string) → Instance
FieldXML typeValue
NamestringWaitForChild

Events

8
AncestryChanged
(child: Instance, parent: Instance) → void
FieldXML typeValue
NamestringAncestryChanged
summarystringFired when any of this object's ancestors change. First argument 'child' is the object whose parent changed. Second argument 'parent' is the first argument's new parent.
AttributeChanged
(attribute: string) → void
FieldXML typeValue
NamestringAttributeChanged
summarystringFired after a custom attribute changes.
ChildAdded
(child: Instance) → void
FieldXML typeValue
NamestringChildAdded
ChildRemoved
(child: Instance) → void
FieldXML typeValue
NamestringChildRemoved
DescendantAdded
(descendant: Instance) → void
FieldXML typeValue
NamestringDescendantAdded
summarystringFired after an Instance is parented to this object, or any of this object's descendants. The 'descendant' argument is the Instance that is being added.
DescendantRemoving
(descendant: Instance) → void
FieldXML typeValue
NamestringDescendantRemoving
summarystringFired after an Instance is unparented from this object, or any of this object's descendants. The 'descendant' argument is the Instance that is being added.
Destroying
() → void
FieldXML typeValue
NamestringDestroying
summarystringFires immediately before this Instance or one of its ancestors is destroyed.
childAdded
(child: Instance) → void
FieldXML typeValue
NamestringchildAdded