Instance

The base of every object. Name it, move it, tag it with attributes of your own and find it again from a script, whatever it is.

Instance is abstract: every class on these pages is one, so its members work on all of them. Name and Parent say where it sits, ClassName what it is. GetAttribute and SetAttribute read and write Roblox-style attributes, which Properties shows as rows and the Nodes window as sockets. FindFirstChild, WaitForChild, IsA, Clone and Destroy work as in Roblox. InstanceHidden hides it and everything under it from the Explorer, except at the top level.

abstractBase

Properties

Data

NameTypeDefaultDescription
ClassNamestring
Namestring
ParentInstanceAny instance can be parented under any other; where it doesn't apply it is inactive, and putting it back where it works makes it work again.

Explorer

InstanceHiddenbooleanfalseHides the instance and its descendants in the Explorer; right-click the parent and pick Show Hidden to see them.

Methods

NameArgumentsReturnsDescription
Clone()InstanceCopies the instance; anything but contents and Root can be copied.
Destroy()()Deletes the instance; from a ToolScript or the command bar it can delete anything but Root and services.
FindFirstAncestor(name: string)Instance?
FindFirstAncestorOfClass(className: string)Instance?
FindFirstAncestorWhichIsA(className: string)Instance?
FindFirstChild(name: string, recursive: boolean?)Instance?
FindFirstChildOfClass(className: string)Instance?
FindFirstChildWhichIsA(className: string, recursive: boolean?)Instance?
GetAttribute(name: string)any
GetAttributes(){[string]: any}
GetChildren(){Instance}
GetDescendants(){Instance}
GetFullName()string
IsA(className: string)booleanTrue when the name is the instance's own class, Instance, or any ancestor in its class tree; unknown names are false.
IsAncestorOf(descendant: Instance)boolean
IsDescendantOf(ancestor: Instance)boolean
SetAttribute(name: string, value: any)()Sets an attribute; nil removes it, and a value of another type is an error.
WaitForChild(name: string)Instance

Subclasses