Skip to content

Class · inherits Instance

HumanoidDescription

Official docs ↗

Describes the appearance of a Humanoid character including body parts, accessories, colors, scales, animations, and emotes.

About HumanoidDescription

HumanoidDescription is an object that stores a description of a Humanoid for R6 and R15 rigs. It can be applied in order to set a rig's scaling, clothing (Shirt, Pants, ShirtGraphic), Accessories, Animations and BodyColors.

You can get a HumanoidDescription by using the following functions:

See also:

Properties 41

Methods 8

  • AddEmote(name: string, assetId: int64) → ()Adds the emote to the description given a name and its asset ID.

    AddEmote will add an Emote asset to the description given a name and its asset ID. The asset ID must be for an "Emote" asset (see Featured emotes in the Catalog).

    You can add multiple emotes of the same name. All emotes of the same name can be removed using RemoveEmote. If an emote with the same ID is added under the same name, EmotesChanged fires.

    See also:

  • GetAccessories(includeRigidAccessories: boolean) → List<AccessoriesInfo>Returns a table of an avatar's current accessories.

    Returns a table of an avatar's current accessories. If the second parameter (includeRigidAccessories) is true then the returned table will also include entries for rigid accessories from the rigid accessory properties.

  • GetEmotes() → DictionaryReturns a dictionary of emotes that have been added or set to this description.

    GetEmotes returns a dictionary of emotes that have been added or set to this description. The keys of this dictionary are the names of the emotes, and the values are a non-empty array of emote IDs for that name.

    Example

    local hd = Instance.new("HumanoidDescription")
    hd:AddEmote("Salute", 3360689775)
    local emotes = hd:GetEmotes()
    for name, ids in emotes do
        print(("The emote %s has %d ids:"):format(name, #ids))
        for _, id in ids do
            print(id)
        end
    end
    

    See also:

  • GetEquippedEmotes() → ArrayReturns an array of tables describing the equipped emotes that have been set.

    GetEquippedEmotes returns an array of tables which indicate the Name and Slot of each equipped emote as it was set by SetEquippedEmotes.

    Example

    local hd = Instance.new("HumanoidDescription")
    hd:SetEmotes({Salute = {3360689775}, Agree = {4849487550}})
    hd:SetEquippedEmotes({"Salute", "Agree"})
    -- Iterate over the equipped emotes:
    for _, t in hd:GetEquippedEmotes() do
        print(("In slot %d: emote %s is equipped"):format(t.Slot, t.Name))
    end
    

    See also:

  • RemoveEmote(name: string) → ()Removes any emotes that have been added under the given name.

    RemoveEmote removes all emotes from the description that have been added or set under the given name. If there are no added emotes with the given name, no error is thrown and EmotesChanged does not fire.

    See also:

  • SetAccessories(accessories: Array, includeRigidAccessories: boolean) → ()Accepts a table that sets the accessories and related properties for an avatar.

    Accepts a table that sets the accessories and related properties for an avatar. If the second parameter (includeRigidAccessories) is true, then this function can also be used to set the rigid accessories in the rigid accessory properties. In this case any table entry that does not have an Order will be considered a rigid accessory and put in the appropriate property according to the AccessoryType.

  • SetEmotes(emotes: Dictionary) → ()Sets all of the emotes on this description.

    SetEmotes sets all of the emotes on this description given a table similar to that returned by GetEmotes. It fires EmotesChanged

    Example

    local emotes = {
        Salute = {3360689775}, -- Syntax note: can also use ["Salute"] = ...
        Agree = {4849487550},
        Disagree = {4849495710}
    }
    local hd = Instance.new("HumanoidDescription")
    hd:SetEmotes(emotes)
    

    See also:

  • SetEquippedEmotes(equippedEmotes: Array) → ()Sets the currently equipped emotes given an array of emote names.

    SetEquippedEmotes sets the currently equipped emotes given an array of emote names as they were passed to AddEmote or SetEmotes. It can also take an array of tables similar to that returned by GetEquippedEmotes. Calling this function fires EquippedEmotesChanged.

    Example

    local hd = Instance.new("HumanoidDescription")
    hd:SetEmotes({Salute = {3360689775}, Agree = {4849487550}})
    -- Can provide either an array of strings... (index is slot number)
    hd:SetEquippedEmotes({"Salute", "Agree"})
    -- ...or an array of tables as returned by GetEquippedEmotes (Slot and Name keys set)
    hd:SetEquippedEmotes({{Slot = 1, Name = "Salute"}, {Slot = 2, Name = "Agree"}})
    

    See also:

Events 2

  • EmotesChangedHumanoidDescription.EmotesChanged:Connect(function(newEmotes))Fires when emotes are added, removed or set on this description.

    EmotesChanged fires when emotes are added, removed or set on the description. The event fires with the new emote table as returned by GetEmotes.

    If AddEmote is called with the same name and ID as an existing emote, this event fires.

    See also:

  • EquippedEmotesChangedHumanoidDescription.EquippedEmotesChanged:Connect(function(newEquippedEmotes))Fires when the equipped emotes are set on this description.

    EquippedEmotesChanged fires when the equipped emotes are set on this description using SetEquippedEmotes. It provides the new equipped emotes in a table like that returned by GetEquippedEmotes.

    Example

    local hd = Instance.new("HumanoidDescription")
    hd.EquippedEmotesChanged:Connect(function(equippedEmotes)
        print(("We have %d emotes equipped"):format(#equippedEmotes))
        for _, t in equippedEmotes do
            print(("In slot %d: emote %s is equipped"):format(t.Slot, t.Name))
        end
    end)
    hd:SetEquippedEmotes({"Salute", "Agree"}) --> We have 2 emotes equipped
    

    See also:

HumanoidDescription also has every member of Instance. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.