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:
- Players:GetHumanoidDescriptionFromUserId(), for an outfit currently being worn by a user on Roblox.
- Players:GetHumanoidDescriptionFromOutfitId(), for an outfit created by a user on Roblox.
- You can create a Humanoid rig model from a HumanoidDescription through Players:CreateHumanoidModelFromDescription().
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
概要
屬性
A JSON formatted array of Layered clothing where each table in the entry in the array describes an accessory's AssetId, AccessoryType, Order, and (optionally) Puffiness as key-value pairs.
A comma-separated list of asset IDs that will be added as Accessories to a Humanoid rig when applied, usually those attached to its back (such as capes).
Determines the factor by which the shape of a Humanoid is interpolated from the standard R15 body shape (0) to a taller and more slender body type (1).
When this description is applied to a Humanoid, this determines the Animation.AnimationId to play when its state is Climbing.
Determines by what factor the depth (back-to-front distance) of a Humanoid is scaled.
Determines the asset ID of the Face to be applied to the Humanoid.
A comma-separated list of asset IDs that will be added as Accessories to a Humanoid rig when applied, usually those attached to the front of its face (such as glasses).
When this description is applied to a Humanoid, this determines the Animation.AnimationId to play when its state is Freefall.
A comma-separated list of asset IDs that will be added as Accessories to a Humanoid rig when applied, usually those attached to front of its torso (such as medals or ties).
Determines the Graphic used by a ShirtGraphic.
A comma-separated list of asset IDs that will be added as Accessories to a Humanoid rig when applied, usually those attached to its head resembling hair.
A comma-separated list of asset IDs that will be added as Accessories to a Humanoid rig when applied, usually those attached to its head.
Determines the asset ID of the Head to be applied to the Humanoid.
Determines the BodyColors.HeadColor3 and BodyColors.HeadColor of a Humanoid when applied.
Determines by what factor the Head object of a Humanoid is scaled, as well as any accessories attached to it.
Determines by what factor the height (top-to-bottom distance) of a Humanoid is scaled, as well as all accessories not attached to its head.
When this description is applied to a Humanoid, this determines the Animation.AnimationId to play when its state is Running at a speed near zero.
When this description is applied to a Humanoid, this determines the Animation.AnimationId to play when its state is Jumping.
Determines the asset ID of the LeftArm to be applied to the Humanoid.
Determines the BodyColors.LeftArmColor3 and BodyColors.LeftArmColor of a Humanoid when applied.
Determines the asset ID of the LeftLeg to be applied to the Humanoid.
Determines the BodyColors.LeftLegColor3 and BodyColors.LeftLegColor of a Humanoid when applied.
A comma-separated list of asset IDs that will be added as Accessories to a Humanoid rig when applied, usually those attached to its neck (such as scarves or necklaces).
Determines the PantsTemplate used by a Pants instance.
Determines how wide (0) or narrow (1) a Humanoid rig is.
Determines the asset ID of the RightArm to be applied to the Humanoid.
Determines the BodyColors.RightArmColor3 and BodyColors.RightArmColor of a Humanoid when applied.
Determines the asset ID of the RightLeg to be applied to the Humanoid.
Determines the BodyColors.RightLegColor3 and BodyColors.RightLegColor of a Humanoid when applied.
When this description is applied to a Humanoid, this determines the Animation.AnimationId to play when its state is Running at a moderate speed.
Determines the ShirtTemplate used by a Shirt instance.
A comma-separated list of asset IDs that will be added as Accessories to a Humanoid rig when applied, usually those attached to its shoulders (such as shoulder-mounted critters).
When this description is applied to a Humanoid, this determines the Animation.AnimationId to play when its state is Swimming.
Determines the asset ID of the Torso to be applied to the Humanoid.
Determines the BodyColors.TorsoColor3 and BodyColors.TorsoColor of a Humanoid when applied.
A comma-separated list of asset IDs that will be added as Accessories to a Humanoid rig when applied, usually those attached to its waist (such as belts).
When this description is applied to a Humanoid, this determines the Animation.AnimationId to play when its state is Running at a low speed.
Determines by what factor the width (left-to-right distance) of a Humanoid is scaled, as well as all accessories not attached to its head.
方法
Adds the emote to the description given a name and its asset ID.
Returns a table of an avatar's current accessories.
Returns a dictionary of emotes that have been added or set to this description.
Returns an array of tables describing the equipped emotes that have been set.
Removes any emotes that have been added under the given name.
Accepts a table that sets the accessories and related properties for an avatar.
Sets all of the emotes on this description.
Sets the currently equipped emotes given an array of emote names.
活動
Fires when emotes are added, removed or set on this description.
Fires when the equipped emotes are set on this description.
屬性
AccessoryBlob
A JSON formatted array of Layered clothing where each table in the entry in the array describes an accessory's AssetId, AccessoryType, Order, and (optionally) Puffiness as key-value pairs. This can be edited in the properties windows for the HumanoidDescription.
To make changes from Lua (which is recommended over editing the JSON directly), use HumanoidDescription:SetAccessories() and HumanoidDescription:GetAccessories(). These methods can also be enabled to work with rigid accessories by setting IncludeRigidAccessories parameters to true.
BackAccessory
BackAccessory is a comma-separated list of asset IDs that determine what accessories should be added when the description is applied. The list cannot contain duplicates.
An error is thrown if you try to apply a new description which shares any assets with the existing description but a different accessory property.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- FaceAccessory, FrontAccessory, HairAccessory, HatAccessory, NeckAccessory, ShouldersAccessory and WaistAccessory, which are similar properties that apply accessories like this one
BodyTypeScale
BodyTypeScale determines the factor by which the shape of a Humanoid is interpolated from the standard R15 body shape (0) to a taller and more slender body type (1). Values outside the range of 0 to 1 are clamped. When the description is applied through Humanoid:ApplyDescription(), this value maps to a BodyTypeScale NumberValue within the Humanoid.
Note that when the value of this property is 0, the ProportionScale property has no effect.
See Also
- HumanoidDescription System, for more information on HumanoidDescription.
- ProportionScale, which also affects rig proportions when this property is non-zero
- HeadScale, which provides specific control over the scale of the rig's head
ClimbAnimation
When this description is applied to a Humanoid, ClimbAnimation determines the Animation.AnimationId to play when its state is Climbing.
See also:
- FallAnimation, IdleAnimation, JumpAnimation, RunAnimation, SwimAnimation and WalkAnimation, which are similar properties that determine animations to play on the rig
DepthScale
DepthScale determines by what factor the depth (back-to-front distance) of a Humanoid is scaled, as well as all accessories not attached to its head. When the description is applied through Humanoid:ApplyDescription(), this value maps to a BodyDepthScale NumberValue within the Humanoid.
See Also
- HumanoidDescription System, for more information on HumanoidDescription.
- BodyTypeScale and ProportionScale, which can provide more realistic rig proportions
Face
Face determines the asset ID of the Face to be applied to a Humanoid. The type of the asset ID provided must be for a Face type asset and not a Decal or Image type asset.
The actual face texture is rendered using a Decal in the Head named "face" or "Face".
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- Head, which can change the mesh of the head
- FaceAccessory, which can apply one or more Accessory objects to the face
FaceAccessory
FaceAccessory is a comma-separated list of asset IDs that determine what accessories should be added when the description is applied, usually those attached to the front of its face (such as glasses). The list does not contain duplicates.
An error is thrown if you try to apply a new description which shares any assets with the existing description but a different accessory property.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- BackAccessory, FrontAccessory, HairAccessory, HatAccessory, NeckAccessory, ShouldersAccessory and WaistAccessory, which are similar properties that apply accessories like this one
- Face, a property that determines what Face texture is used on the head
FallAnimation
When this description is applied to a Humanoid, FallAnimation determines the Animation.AnimationId to play when its state is Freefall.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- ClimbAnimation, IdleAnimation, JumpAnimation, RunAnimation, SwimAnimation and WalkAnimation, which are similar properties that determine animations to play on the rig
FrontAccessory
FrontAccessory is a comma-separated list of asset IDs that determine what accessories should be added when the description is applied, usually those attached to front of its torso (such as medals or ties). The list does not contain duplicates.
An error is thrown if you try to apply a new description which shares any assets with the existing description but a different accessory property.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- BackAccessory, FaceAccessory, HairAccessory, HatAccessory, NeckAccessory, ShouldersAccessory and WaistAccessory, which are similar properties that apply accessories like this one
GraphicTShirt
GraphicTShirt determines the Graphic used by a ShirtGraphic instance when Humanoid:ApplyDescription() is called on a Humanoid. The asset type must be for a T‑Shirt, not a Decal or Image.
See Also
- HumanoidDescription System, for more information on HumanoidDescription.
- Shirt, which can provide the same functionality in addition to providing textures for the entire torso and arms
- TorsoColor, which can change the color of the torso underneath the t-shirt texture
HairAccessory
HairAccessory is a comma-separated list of asset IDs that determine what accessories should be added when the description is applied, usually those attached to its head resembling hair. The list does not contain duplicates.
An error is thrown if you try to apply a new description which shares any assets with the existing description but a different accessory property.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- BackAccessory, FaceAccessory, FrontAccessory, HatAccessory, NeckAccessory, ShouldersAccessory and WaistAccessory, which are similar properties that apply accessories like this one
HatAccessory
HatAccessory is a comma-separated list of asset IDs that determine what accessories should be added when the description is applied, usually those attached to its head. The list does not contain duplicates.
An error is thrown if you try to apply a new description which shares any assets with the existing description but a different accessory property.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- BackAccessory, FaceAccessory, FrontAccessory, HairAccessory, NeckAccessory, ShouldersAccessory and WaistAccessory, which are similar properties that apply accessories like this one
Head
Head determines the asset ID of the Head to be applied to a Humanoid.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- HeadColor, which controls the color of this limb
- HatAccessory, HairAccessory and FaceAccessory, which all can apply Accessory objects which are joined to the head
HeadColor
HeadColor determines the BodyColors.HeadColor3 and BodyColors.HeadColor of a Humanoid when the description is applied.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- TorsoColor, LeftArmColor, RightArmColor, LeftLegColor, and RightLegColor, which are similar properties that also control body colors
- Head, which controls the mesh used for the head
- Face, which applies a texture to the front of the head
HeadScale
HeadScale determines by what factor the Head object of a Humanoid is scaled, as well as any accessories attached to it (such as those specified by HatAccessory and HairAccessory). When the description is applied through Humanoid:ApplyDescription(), this value maps to a HeadScale NumberValue within the Humanoid.
See Also
- HumanoidDescription System, for more information on HumanoidDescription.
- BodyTypeScale and ProportionScale, which can provide realistic rig proportions
HeightScale
HeightScale determines by what factor the height (top-to-bottom distance) of a Humanoid is scaled, as well as all accessories not attached to its head. When the description is applied through Humanoid:ApplyDescription(), this value maps to a BodyHeightScale NumberValue within the Humanoid.
See Also
- HumanoidDescription System, for more information on HumanoidDescription.
- BodyTypeScale and ProportionScale, which can provide more realistic rig proportions
- WidthScale and DepthScale
IdleAnimation
When this description is applied to a Humanoid, IdleAnimation determines the Animation.AnimationId to play when its state is Running at a speed near zero.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- ClimbAnimation, FallAnimation, JumpAnimation, RunAnimation, SwimAnimation and WalkAnimation, which are similar properties that determine animations to play on the rig
JumpAnimation
When this description is applied to a Humanoid, JumpAnimation determines the Animation.AnimationId to play when its state is Jumping.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- ClimbAnimation, FallAnimation, IdleAnimation, RunAnimation, SwimAnimation and WalkAnimation, which are similar properties that determine animations to play on the rig
LeftArm
LeftArm determines the asset ID of the LeftArm to be applied to a Humanoid.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- LeftArmColor, which controls the color of this limb
LeftArmColor
LeftArmColor determines the BodyColors.LeftArmColor3 and BodyColors.LeftArmColor of a Humanoid when the description is applied. For R15 and Rthro rigs, this property controls both the upper, lower, and hand parts of the left arm.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- HeadColor, TorsoColor, RightArmColor, LeftLegColor, and RightLegColor, which are similar properties that also control body colors
- LeftArm, which controls the mesh used for this limb
- Shirt, which can apply a texture to this limb
LeftLeg
LeftLeg determines the asset ID of the LeftLeg to be applied to a Humanoid.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- LeftLegColor, which controls the color of this limb
LeftLegColor
LeftLegColor determines the BodyColors.LeftLegColor3 and BodyColors.LeftLegColor of a Humanoid when the description is applied. For R15 and Rthro rigs, this property controls both the upper, lower, and foot parts of the left leg.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- HeadColor, TorsoColor, LeftArmColor, RightArmColor, and RightLegColor, which are similar properties that also control body colors
- LeftLeg, which controls the mesh used for this limb
- Pants, which can apply a texture to this limb
MoodAnimation
NeckAccessory
NeckAccessory is a comma-separated list of asset IDs that determine what accessories should be added when the description is applied, usually those attached to its neck (such as scarves or necklaces). The list does not contain duplicates.
Any accessory can used in this property, even if it is meant to go in a different accessory spot. For example, an accessory meant to go on your back (such as a cape) could be included in HairAccessory. An error is thrown if you try to apply a new description which shares any assets with the existing description but a different accessory property.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- BackAccessory, FaceAccessory, FrontAccessory, HairAccessory, HatAccessory, ShouldersAccessory and WaistAccessory, which are similar properties that apply accessories like this one
Pants
Pants determines the PantsTemplate used by a Pants instance when Humanoid:ApplyDescription() is called on a Humanoid. The asset type must be for Pants, not a Decal or Image.
See Also
- HumanoidDescription System, for more information on HumanoidDescription.
- TorsoColor, LeftLegColor and RightLegColor, which can change the color of the body parts underneath the pants texture
ProportionScale
ProportionScale determines how wide (0) or narrow (1) a Humanoid rig is. Values outside the range of 0 to 1 are clamped. When the description is applied through Humanoid:ApplyDescription(), this value maps to a BodyProportionScale NumberValue within the Humanoid.
Note that when the value of BodyTypeScale is 0, this property has no effect.
See Also
- HumanoidDescription System, for more information on HumanoidDescription.
- BodyTypeScale, which also affects rig proportions
- HeadScale, which provides specific control over the scale of the rig's head
RightArm
RightArm determines the asset ID of the RightArm to be applied to a Humanoid.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- RightArmColor, which controls the color of this limb
RightArmColor
RightArmColor determines the BodyColors.RightArmColor3 and BodyColors.RightArmColor of a Humanoid when the description is applied. For R15 and Rthro rigs, this property controls both the upper, lower, and hand parts of the right arm.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- HeadColor, TorsoColor, LeftArmColor, LeftLegColor, and RightLegColor, which are similar properties that also control body colors
- RightArm, which controls the mesh used for this limb
- Shirt, which can apply a texture to this limb
RightLeg
RightLeg determines the asset ID of the RightLeg to be applied to a Humanoid.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- RightLegColor, which controls the color of this limb
RightLegColor
RightLegColor determines the BodyColors.RightLegColor3 and BodyColors.RightLegColor of a Humanoid when the description is applied. For R15 and Rthro rigs, this property controls both the upper, lower, and foot parts of the right leg.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- HeadColor, TorsoColor, LeftArmColor, RightArmColor, and LeftLegColor, which are similar properties that also control body colors
- RightLeg, which controls the mesh used for this limb
- Pants, which can apply a texture to this limb
RunAnimation
When this description is applied to a Humanoid, RunAnimation determines the Animation.AnimationId to play when its state is Running at a moderate speed.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- ClimbAnimation, FallAnimation, IdleAnimation, JumpAnimation, SwimAnimation and WalkAnimation, which are similar properties that determine animations to play on the rig
Shirt
Shirt determines the ShirtTemplate used by a Shirt instance when Humanoid:ApplyDescription() is called on a Humanoid. The asset type must be for Shirt, not a Decal or Image.
See Also
- HumanoidDescription System, for more information on HumanoidDescription.
- GraphicTShirt, a similar property which applies to a ShirtGraphic object
- TorsoColor, LeftArmColor and RightArmColor, which can change the color of the body parts underneath the shirt texture
ShouldersAccessory
ShouldersAccessory is a comma-separated list of asset IDs that determine what accessories should be added when the description is applied, usually those attached to its shoulders (such as shoulder-mounted critters). The list does not contain duplicates.
An error is thrown if you try to apply a new description which shares any assets with the existing description but a different accessory property.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- BackAccessory, FaceAccessory, FrontAccessory, HairAccessory, HatAccessory, NeckAccessory and WaistAccessory, which are similar properties that apply accessories like this one
SwimAnimation
When this description is applied to a Humanoid, SwimAnimation determines the Animation.AnimationId to play when its state is Swimming
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- ClimbAnimation, FallAnimation, IdleAnimation, JumpAnimation, RunAnimation and WalkAnimation, which are similar properties that determine animations to play on the rig
Torso
Torso determines the asset ID of the Torso to be applied to a Humanoid.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- TorsoColor, which controls the color of this limb
TorsoColor
TorsoColor determines the BodyColors.TorsoColor3 and BodyColors.TorsoColor of a Humanoid when the description is applied. For R15 and Rthro rigs, this property controls both the upper and lower parts of the torso.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- HeadColor, TorsoColor, LeftArmColor, RightArmColor, LeftLegColor, and RightLegColor, which are similar properties that also control body colors
- Torso, which controls the mesh used for this body part
- GraphicTShirt and Shirt, which can apply a texture to this body part
WaistAccessory
WaistAccessory is a comma-separated list of asset IDs that determine what accessories should be added when the description is applied, usually those attached to its waist (such as belts). The list does not contain duplicates.
An error is thrown if you try to apply a new description which shares any assets with the existing description but a different accessory property.
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- BackAccessory, FaceAccessory, FrontAccessory, HairAccessory, HatAccessory, NeckAccessory and ShouldersAccessory, which are similar properties that apply accessories like this one
WalkAnimation
When this description is applied to a Humanoid, WalkAnimation determines the Animation.AnimationId to play when its state is Running at a low speed
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- ClimbAnimation, FallAnimation, IdleAnimation, JumpAnimation, RunAnimation and SwimAnimation, which are similar properties that determine animations to play on the rig
WidthScale
WidthScale determines by what factor the width (left-to-right distance) of a Humanoid is scaled, as well as all accessories not attached to its head. When the description is applied through Humanoid:ApplyDescription(), this value maps to a BodyWidthScale NumberValue within the Humanoid.
See Also
- HumanoidDescription System, for more information on HumanoidDescription.
- BodyTypeScale and ProportionScale, which can provide more realistic rig proportions
方法
AddEmote
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:
- HumanoidDescription System, for more information on HumanoidDescription.
- GetEmotes, which can be used to retrieve the emotes that have been added by this function
- SetEmotes and RemoveEmote, which also manipulate what emotes have been added
- EmotesChanged, which fires after this function is called
參數
A string that identifies what emote is being added. Example: "Salute".
An emote asset ID.
返回
GetAccessories
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.
參數
Set to true if rigid accessories from the rigid accessory properties should also be included in the return array. False means only include layered clothing accessories from the AccessoryBlob.
返回
Returns an array where each entry specifies for an individual accessory the AccessoryType, AssetId, IsLayered, Order and Puffiness.
範例程式碼
local includeRigidAccessories = true
local accessoriesTable = game:GetService("Players"):GetHumanoidDescriptionFromUserId(1):GetAccessories(includeRigidAccessories)
for _, accessoryInfo in ipairs(accessoriesTable) do
print(tostring(accessoryInfo.AssetId) .. " " .. tostring(accessoryInfo.AccessoryType))
end
GetEmotes
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 doprint(("The emote %s has %d ids:"):format(name, #ids))for _, id in ids doprint(id)endend
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- EmotesChanged, which fires with the value returned this function after it may have changed
返回
A dictionary of emotes where the key is the emote name and the value is an array of emote asset IDs. Example:
{Salute = {3360689775},Agree = {4849487550},Disagree = {4849495710}}
.
GetEquippedEmotes
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() doprint(("In slot %d: emote %s is equipped"):format(t.Slot, t.Name))end
See also:
- HumanoidDescription System, for more information on HumanoidDescription.
- SetEquippedEmotes, which sets the currently equipped emotes and changes what this function returns
- EquippedEmotesChanged, which fires when the function returned by this value may have changed
返回
An array of tables describing the name and slot which each emote is equipped. Example:
{{Slot = 3, Name = "Salute"},{Slot = 2, Name = "Agree"},{Slot = 1, Name = "Disagree"},}
.
RemoveEmote
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:
- HumanoidDescription System, for more information on HumanoidDescription.
- GetEmotes, which can retrieve a dictionary of emotes that may be removed
參數
返回
SetAccessories
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.
參數
Each entry specifies for an individual accessory the AccessoryType, AssetId, IsLayered, Order and Puffiness.
Set to true if rigid accessories are also included in the passed in array (they would have to not specify Order).
返回
範例程式碼
local humanoidDescription = Instance.new("HumanoidDescription")
local originalSpecifications = {
{
Order = 1,
AssetId = 123456789,
Puffiness = 0.5,
AccessoryType = Enum.AccessoryType.Sweater
}
}
humanoidDescription:SetAccessories(originalSpecifications)
local updatedSpecifications = humanoidDescription:GetAccessories(false)
local newIndividualSpecification = {
Order = 2,
AssetId = 987654321,
Puffiness= 0.7,
AccessoryType = Enum.AccessoryType.Jacket,
IsLayered = true
}
updatedSpecifications[#updatedSpecifications + 1] = newIndividualSpecification
humanoidDescription:SetAccessories(updatedSpecifications)
SetEmotes
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:
- HumanoidDescription System, for more information on HumanoidDescription.
- AddEmote and RemoveEmote which can modify the added emotes on an individual level
- EmotesChanged, which fires when this function is called
參數
A dictionary of emotes where the key is the emote name and the value is an array of emote asset IDs. Example:
{Salute = {3360689775},Agree = {4849487550},Disagree = {4849495710}}
.
返回
SetEquippedEmotes
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:
- HumanoidDescription System, for more information on HumanoidDescription.
- GetEquippedEmotes, which returns a value describing the equipped emotes set by this function
- EquippedEmotesChanged, which fires when this function is called
參數
An array of emote names. Example:
{ "Disagree", "Agree", "Salute" }
– OR – An array of tables describing the name and slot which each emote is equipped. Example:
{{Slot = 3, Name = "Salute"},{Slot = 2, Name = "Agree"},{Slot = 1, Name = "Disagree"},}
.
返回
活動
EmotesChanged
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:
- HumanoidDescription System, for more information on HumanoidDescription.
參數
A dictionary of emotes where the key is the emote name and the value is an array of emote asset IDs. Example:
{Salute = {3360689775},Agree = {4849487550},Disagree = {4849495710}}
.
EquippedEmotesChanged
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 System, for more information on HumanoidDescription.
- SetEquippedEmotes, which fires this event
- GetEquippedEmotes, which can be used to query the currently equipped emotes without this event firing
參數
An array of tables describing the name and slot which each emote is equipped. Example:
{{Slot = 3, Name = "Salute"},{Slot = 2, Name = "Agree"},{Slot = 1, Name = "Disagree"},}
.