LoadCharacterWithHumanoidDescription
This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts.
This function spawns an avatar so it has everything equipped in the passed in HumanoidDescription
.
After calling LoadCharacterWithHumanoidDescription for an individual player, it is not recommended to call the function again for the same player until after that player’s Player/CharacterAppearanceLoaded
event has fired.
See also
Articles/HumanoidDescription System|Humanoid Description System
, an article which explains the humanoid description system in greater detail and provides several scripting examples
Parameters
Name | Type | Default | Description |
---|---|---|---|
|
A |
Returns
Return Type | Summary |
---|---|
No return |
Code Samples
Spawn Characters With HumanoidDescription
To create a HumanoidDescription
and then spawn a character with that description applied, add a Script
(not a LocalScript
) to the workspace and add this code to it:
-- Stop automatic spawning so it can be done in the "PlayerAdded" callback game.Players.CharacterAutoLoads = false local function onPlayerAdded(player) -- Create a HumanoidDescription local humanoidDescription = Instance.new("HumanoidDescription") humanoidDescription.HatAccessory = "2551510151,2535600138" humanoidDescription.BodyTypeScale = 0.1 humanoidDescription.ClimbAnimation = 619521311 humanoidDescription.Face = 86487700 humanoidDescription.GraphicTShirt = 1711661 humanoidDescription.HeadColor = Color3.new(0, 1, 0) -- Spawn character with the HumanoidDescription player:LoadCharacterWithHumanoidDescription(humanoidDescription) end -- Connect "PlayerAdded" event to "onPlayerAdded()" function game.Players.PlayerAdded:Connect(onPlayerAdded)