HumanoidDescription:GetAccessories returns empty table

Hi Devforum,
I’m trying to use HumanoidDescription’s GetAccessories function to get an array of all accessories in that HumanoidDescription.
I expect the table to be full of of my own avatar’s accessory IDs, but instead it is empty.
This is my code:

local Players = game:FindService("Players")
for i,v in pairs(Players:GetHumanoidDescriptionFromUserId(85264884):GetAccessories(true)) do
	print(v)
end

And there is no output, because the for loop doesn’t do anything when the table is empty.
Any help would be greatly appreciated.
Thank you!

1 Like

That’s strange - it should hand you an array without an exception. Does it print the Humanoid’s description at all? If not, I presume it may be affected by Roblox’s service disruptions (http://status.roblox.com/).

The description itself looks fine. If I parent it to workspace:

local Players = game:FindService("Players")
local Desc = Players:GetHumanoidDescriptionFromUserId(85264884)
Desc.Parent = workspace

And look in the explorer, the accessory properties show the expected IDs

Alright, I think it’s on behalf of Roblox’s fault that it can’t get accessories as intended - it’s surprising that it returns an empty array. I’ve created an alternative for this that creates a table:

local plrs = game:GetService("Players")
local desc = plrs:GetHumanoidDescriptionFromUserId(121227196)
local accessories = {
	["BackAccessory"] = {};
	["FaceAccessory"] = {};
	["FrontAccessory"] = {};
	["HairAccessory"] = {};
	["HatAccessory"] = {};
	["NeckAccessory"] = {};
	["ShouldersAccessory"] = {};
	["WaistAccessory"] = {}
}
for accessory, id in pairs(accessories) do
	local split = desc[accessory]:split(",")
	if not split[2] then accessories[accessory] = desc[accessory] continue end
	accessories[accessory] = split
end
print(accessories)
3 Likes

This is a very helpful alternative, thank you.

1 Like

If you want to know, this function isn’t implemented as of now, I got this information from a Roblox admin when reporting this as a bug.