However all of their HumanoidDescriptions are the same, and they’re all wrong. Is there anyway for me to generate the correct humanoid description quickly?
Thanks
PS. Can’t decide whether this should go in building or scripting support
HumanoidDescription works as information about “Player” “Character” avatar, if you are trying to use a “Dummy” or “Humanoid” from Roblox Studio, you will need to set each part into “HumanoidDescription” propretie. The only way I know on how to get “HumanoidDescription” of a avatar is only from a Roblox “Player”.
One more easy way… I think. Is that you loop through every character parts. Gathering all the info needed for HumanoidDescription and then yea. Or just manually do it. I hope you understand what I mean.
Could use the console with a for i,v in pairs to apply all the clothing assets that are on the character, as @Qinrir said, to the humanoid description. So something similar to:
ListOfCharacters = workspace.GroupOfCharacters:GetChildren() -- Linking a model or folder of all of your characters.
for _,Character in ipairs(ListOfCharacters) do
local HumanoidDescription = Character.Humanoid.HumanoidDescription:GetAppliedDescription()
HumanoidDescription.Shirt = Character.Shirt.ShirtTemplate
HumanoidDescription.Pants = Character.Pants.PantsTemplate
HumanoidDescription.HeadColor = Character["Body Colors"].HeadColor
HumanoidDescription.LeftArmColor = Character["Body Colors"].LeftArmColor
HumanoidDescription.LeftLegColor = Character["Body Colors"].LeftLegColor
HumanoidDescription.RightArmColor = Character["Body Colors"].RightArmColor
HumanoidDescription.RightLegColor = Character["Body Colors"].RightLegColor
HumanoidDescription.TorsoColor = Character["Body Colors"].TorsoColor
--Regarding accessories, they're a bit more elaborate and a pain to actually code out, at least for me. So, unless if you find someone with some better programming skills than I, you'd unfortunately have to apply them manually.
end
Okay, since I have all of the asset IDs for all of the items anyway, I’ve managed to make a script that generates a HumanoidDescription with the IDs:
local ids = {}
print("Running")
local humanoidDescription = Instance.new("HumanoidDescription")
local MPS = game:GetService("MarketplaceService")
local back = ""
local face = ""
local front = ""
local hair = ""
local hats = ""
local neck = ""
local shoulder = ""
local waist = ""
for index,id in pairs(ids) do
local asset = MPS:GetProductInfo(id)
local t = asset.AssetTypeId
if t == 11 then
humanoidDescription.Shirt = id
elseif t == 12 then
humanoidDescription.Pants = id
else
-- Must be something else
if t == 46 then -- Back Accessory
back = back..","..tostring(id)
elseif t == 42 then -- Face Accessory
face = face..","..tostring(id)
elseif t == 45 then -- front
front = front..","..tostring(id)
elseif t == 41 then -- hair
hair = hair..","..tostring(id)
elseif t == 8 then -- hat
hats = hats..","..tostring(id)
elseif t == 43 then -- neck
neck= neck..","..tostring(id)
elseif t == 44 then -- shoulder
shoulder = shoulder..","..tostring(id)
elseif t == 47 then -- waist
waist = waist..","..tostring(id)
end
-- Not an accessory
if t == 18 then -- face
humanoidDescription.Face = id
elseif t == 17 then -- head
humanoidDescription.Head = id
elseif t == 29 then -- left arm
humanoidDescription.LeftArm = id
elseif t == 30 then -- left leg
humanoidDescription.LeftLeg = id
elseif t == 28 then -- right arm
humanoidDescription.RightArm = id
elseif t == 31 then -- right leg
humanoidDescription.RightLeg = id
elseif t == 27 then -- torso
humanoidDescription.Torso = id
end
end
end
warn("Back: "..back)
humanoidDescription.BackAccessory = back
warn("Face: "..face)
humanoidDescription.FaceAccessory = face
warn("Front: "..front)
humanoidDescription.FrontAccessory = front
warn("Hair: "..hair)
humanoidDescription.HairAccessory = hair
warn("Hats: "..hats)
humanoidDescription.HatAccessory = hats
warn("Neck: "..neck)
humanoidDescription.NeckAccessory = neck
warn("Shoulder: "..shoulder)
humanoidDescription.ShouldersAccessory = shoulder
warn("Waist: "..waist)
humanoidDescription.WaistAccessory = waist
humanoidDescription.Parent = workspace
print "finish"
It’s not very pretty, but it’s only made to run in the command bar,