Skip to content
Roblox API Reference

Instance

Instance is the base class for all classes in the Roblox class hierarchy which can be part of the DataModel tree.
  • Not browsable
  • Not creatable
Memory category
Instances
Own members
69
Inherited members
6
Subclasses
608
Siblings
30

Properties23

Inherited fromObject2

Property categoryData

Defined byInstance21

Property categoryBehavior

Property categoryData

  • Instance.Attributes: string
    • Hidden
    • Not scriptable
    • Read only
    • Roblox engine security
  • Instance.AttributesReplicate: string
    • Hidden
    • Not scriptable
    • Roblox engine security
  • Instance.AttributesSerialize: string
    • Hidden
    • Not replicated
    • Not scriptable
    • Roblox engine security
  • Instance.HistoryId: UniqueId
    • Hidden
    • Not replicated
    • Not scriptable
    • Roblox engine security
  • Instance.Name: string
    A non-unique identifier of the Instance.
  • Instance.Parent: Instance
    Determines the hierarchical parent of the Instance.
    • Not replicated
    • Load only
  • Instance.PredictionMode: Enum.PredictionMode
    Reflects the client-side prediction mode applied to the instance under server-authoritative physics.
    • Not scriptable
    • Read only
  • Instance.PropertyStatusStudio: Enum.PropertyStatus
    • Hidden
    • Not scriptable
    • Read only
    • Roblox engine security
  • Instance.RobloxLocked: boolean
    A deprecated property that used to protect CoreGui objects.
    • Hidden
    • Plugin security
  • Instance.SerializedOverrides: string
    • Hidden
    • Not replicated
    • Not scriptable
    • Roblox engine security
  • Instance.SourceAssetId: number
    • Hidden
    • Roblox script security
  • Instance.Tags: SharedString
    • Hidden
    • Not scriptable
    • Roblox engine security
  • Instance.UniqueId: UniqueId
    A unique identifier for the instance.
    • Not replicated
    • Read: Roblox script security
    • Write: Roblox engine security
  • Instance.numExpectedDirectChildren: number
    • Hidden
    • Not scriptable
  • Instance.DataCost: number
    • Deprecated
    • Hidden
    • Read only
    • Local user security

Property categoryPermissions

  • Instance.Capabilities: SecurityCapabilities
    The set of capabilities allowed to be used for scripts inside this container.
    • Capabilities: CapabilityControl
  • Instance.DefinesCapabilities: boolean
    • Hidden
    • Not scriptable
    • Roblox engine security
  • Instance.IsInSandbox: boolean
    Indicates whether the instance is inside a sandboxed container.
    • Not scriptable
    • Read only
  • Instance.Sandboxed: boolean
    When enabled, the instance can only access abilities in its Capabilities list.
    • Not replicated
    • Capabilities: CapabilityControl

Methods42

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Defined byInstance39
  • Instance:AddTag(tag: string)
    Applies a tag to the instance.
    Parameters
    ParameterDescription
    tag: string
    The tag to apply to the instance.
  • Instance:ClearAllChildren()
    This method destroys all of an instance's children.
  • Instance:Clone(): Instance
    Create a copy of an instance and all its descendants, ignoring instances that are not Archivable.
    • Capabilities: CreateInstances
    • Simulation access
    Returns
    TypeDescription
    Instance
    A copy of the instance, or nil if the instance is not Archivable.
  • Instance:Destroy()
    Sets the Instance.Parent property to nil, locks the Instance.Parent property, disconnects all connections, and calls Destroy() on all children.
  • Instance:FindFirstAncestor(name: string): Instance
    Returns the first ancestor of the Instance whose Instance.Name is equal to the given name.
    • Thread safe
    Parameters
    ParameterDescription
    name: string
    The Instance.Name to be looked for.
    Returns
    TypeDescription
    Instance
    The Instance found.
  • Instance:FindFirstAncestorOfClass(className: string): Instance
    Returns the first ancestor of the Instance whose Object.ClassName is equal to the given className.
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The Object.ClassName to be looked for.
    Returns
    TypeDescription
    Instance
    The Instance found.
  • Instance:FindFirstAncestorWhichIsA(className: string): Instance
    Returns the first ancestor of the Instance for whom Object:IsA() returns true for the given className.
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The Object.ClassName to be looked for.
    Returns
    TypeDescription
    Instance
    The Instance found.
  • Instance:FindFirstChild(name: string, recursive: boolean? = false): Instance
    Returns the first child of the Instance found with the given name.
    • Thread safe
    • Simulation access
    Parameters
    ParameterDescription
    name: string
    The Instance.Name to be searched for.
    recursive: boolean? = false
    Whether or not the search should be conducted recursively.
    Returns
    TypeDescription
    Instance
    The Instance found.
  • Instance:FindFirstChildOfClass(className: string): Instance
    Returns the first child of the Instance whose ClassName is equal to the given class name.
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The Object.ClassName to be looked for.
    Returns
    TypeDescription
    Instance
    The Instance found.
  • Instance:FindFirstChildWhichIsA(className: string,recursive: boolean? = false,): Instance
    Returns the first child of the Instance for whom Object:IsA() returns true for the given className.
    • Thread safe
    • Simulation access
    Parameters
    ParameterDescription
    className: string
    The Object.ClassName to be searched for.
    recursive: boolean? = false
    Whether or not the search should be conducted recursively.
    Returns
    TypeDescription
    Instance
    The Instance found.
  • Instance:FindFirstDescendant(name: string): Instance
    Returns the first descendant found with the given Instance.Name.
    • Thread safe
    Parameters
    ParameterDescription
    name: string
    The Instance.Name to search for.
    Returns
    TypeDescription
    Instance
    The Instance found.
  • Instance:GetActor(): Actor
    Returns the Actor associated with the Instance, if any.
    • Thread safe
    Returns
    TypeDescription
    Actor
    The Actor found.
  • Instance:GetAttribute(attribute: string): any
    Returns the value which has been assigned to the given attribute name.
    • Thread safe
    • Simulation access
    Parameters
    ParameterDescription
    attribute: string
    The name of the attribute being retrieved.
    Returns
    TypeDescription
    any
    The value which has been assigned to the given attribute name. If no attribute has been assigned, nil is returned.
  • Instance:GetAttributeChangedSignal(attribute: string): RBXScriptSignal
    Returns an event that fires when the given attribute changes.
    Parameters
    ParameterDescription
    attribute: string
    The name of the specified attribute for which the change signal is being returned.
    Returns
    TypeDescription
    RBXScriptSignal
    An event that fires when the given attribute changes.
  • Instance:GetAttributes(): { [string]: any }
    Returns a dictionary of the instance's attributes.
    • Custom Lua state
    • Thread safe
    • Simulation access
    Returns
    TypeDescription
    { [string]: any }
    A dictionary of string → variant pairs for each attribute where the string is the name of the attribute and the variant is a non-nil value.
  • Instance:GetChildren(): { Instance }
    Returns an array containing all of the instance's children.
    • Thread safe
    • Simulation access
    Returns
    TypeDescription
    { Instance }
    An array containing the instance's children.
  • Instance:GetDebugId(scopeLength: number? = 4): string
    Returns a coded string of the debug ID used internally by Roblox.
    • Not browsable
    • Plugin security
    Parameters
    ParameterDescription
    scopeLength: number? = 4
    The scope length.
    Returns
    TypeDescription
    string
    The Debug ID string.
  • Instance:GetDescendants(): { Instance }
    Returns an array containing all of the descendants of the instance.
    • Custom Lua state
    • Thread safe
    • Simulation access
    Returns
    TypeDescription
    { Instance }
    An array containing the instance's descendants.
  • Instance:GetFullName(): string
    Returns a string describing the instance's ancestry.
    • Thread safe
    • Simulation access
    Returns
    TypeDescription
    string
    The full name of the Instance.
  • Instance:GetStyled(name: string, selector: string?): any
    Returns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified.
    Parameters
    ParameterDescription
    name: string
    Name of the property to query.
    selector: string?
    Optional selector for the pseudo instance you are targeting on the instance.
    Returns
    TypeDescription
    any
    The styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified.
  • Instance:GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
    Returns an event that fires when the given style property changes on the instance.
    Parameters
    ParameterDescription
    property: string
    Name of the style property for which to listen for changes.
    Returns
    TypeDescription
    RBXScriptSignal
    Event that fires when the given style property changes.
  • Instance:GetTags(): { any }
    Gets an array of all tags applied to the instance.
    • Thread safe
    • Simulation access
    Returns
    TypeDescription
    { any }
    An array of strings, each representing a tag applied to the instance.
  • Instance:HasTag(tag: string): boolean
    Check whether the instance has a given tag.
    • Thread safe
    • Simulation access
    Parameters
    ParameterDescription
    tag: string
    The tag to check for on the instance.
    Returns
    TypeDescription
    boolean
    true if the instance has the given tag, false otherwise.
  • Instance:IsAncestorOf(descendant: Instance): boolean
    Returns true if an Instance is an ancestor of the given descendant.
    • Thread safe
    • Simulation access
    Parameters
    ParameterDescription
    descendant: Instance
    The descendant Instance.
    Returns
    TypeDescription
    boolean
    True if the Instance is an ancestor of the given descendant.
  • Instance:IsDescendantOf(ancestor: Instance): boolean
    Returns true if an Instance is a descendant of the given ancestor.
    • Thread safe
    • Simulation access
    Parameters
    ParameterDescription
    ancestor: Instance
    The ancestor Instance.
    Returns
    TypeDescription
    boolean
    True if the Instance is a descendant of the given ancestor.
  • Instance:IsPropertyModified(property: string): boolean
    Returns true if the value stored in the specified property is not equal to the code-instantiated default.
    • Simulation access
    Parameters
    ParameterDescription
    property: string
    Name of the property to query.
    Returns
    TypeDescription
    boolean
    Boolean indicating whether the property is modified from its code‑instantiated default.
  • Instance:QueryDescendants(selector: string): { Instance }
    Returns an array containing all descendants of the instance that match the selector string.
    • Custom Lua state
    • Simulation access
    Parameters
    ParameterDescription
    selector: string
    Selector string used to filter elements.
    Returns
    TypeDescription
    { Instance }
    An array of instances (empty if nothing matched the selector).
  • Instance:RemoveTag(tag: string)
    Removes a tag from the instance.
    Parameters
    ParameterDescription
    tag: string
    The tag to remove from the instance.
  • Instance:ResetPropertyToDefault(property: string)
    Resets a property to its default value.
    Parameters
    ParameterDescription
    property: string
    Name of the property to reset.
  • Instance:SetAttribute(attribute: string, value: any)
    Sets the attribute with the given name to the given value.
    • Simulation access
    Parameters
    ParameterDescription
    attribute: string
    The name of the attribute being set.
    value: any
    The value to set the specified attribute to.
  • Instance:WaitForChild(childName: string, timeOut: number): Instance
    Returns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does.
    • Can yield
    • Custom Lua state
    Parameters
    ParameterDescription
    childName: string
    The Instance.Name to be looked for.
    timeOut: number
    An optional time out parameter.
    Returns
    TypeDescription
    Instance
    The Instance found.
  • Instance:Remove()
    Deprecated: This item is deprecated in favor of Instance:Destroy() and Instance:ClearAllChildren(). If you must remove an object from the game, and wish to use the object later, set its Parent property to nil instead of using this method.
    Sets the object's Parent to nil, and does the same for all its descendants.
    • Deprecated
  • Instance:children(): { Instance }
    Deprecated: This item has been superseded by Instance:GetChildren() which should be used in all new work.
    Returns an array of the object's children.
    • Deprecated
    Returns
    TypeDescription
    { Instance }
    Array of child objects/instances.

    Use GetChildren instead.

  • Instance:clone(): Instance
    Deprecated: This deprecated function is a variant of Instance:Clone() which should be used instead.
    • Deprecated
    • Capabilities: CreateInstances
    • Simulation access
    Returns
    Type
    Instance

    Use Clone instead.

  • Instance:destroy()
    Deprecated: This deprecated function is a variant of Instance:Destroy() which should be used instead.
    • Deprecated

    Use Destroy instead.

  • Instance:findFirstChild(name: string, recursive: boolean? = false): Instance
    Deprecated: This deprecated function is a variant of Instance:FindFirstChild() which should be used instead.
    • Deprecated
    • Simulation access
    Parameters
    Parameter
    name: string
    recursive: boolean? = false
    Returns
    Type
    Instance

    Use FindFirstChild instead.

  • Instance:getChildren(): { Instance }
    Deprecated: This deprecated function is a variant of Instance:GetChildren() which should be used instead.
    • Deprecated
    Returns
    Type
    { Instance }

    Use GetChildren instead.

  • Instance:isDescendantOf(ancestor: Instance): boolean
    Deprecated: This deprecated function is a variant of Instance:IsDescendantOf() which should be used instead.
    • Deprecated
    • Simulation access
    Parameters
    Parameter
    ancestor: Instance
    Returns
    Type
    boolean

    Use IsDescendantOf instead.

  • Instance:remove()
    Deprecated: This deprecated function is a variant of Instance:Remove() which has also been deprecated. Neither function should be used in new work.
    • Deprecated

    Use Remove instead.

Events10

Inherited fromObject1
Defined byInstance9