Unabla to get player's 3D layered Accessories

I’m trying to basically go thro the player’s HumanoidDescription to get all items ID and use them accordingly in my script.

My current issue is that we cannot get the “AccessoryBlob” as it result in it not being part of the HumanoidDescription.
(AccessoryBlob contains 3D Layered Accessories, which is what I’m missing in my system)

I’ve tried switching to Humanoid:GetAccessories() with no result (or maybe i’m doing it wrong because it’s not even documented properly)

Any help would be greatly appreciated.

local function getProductInfo(itemId)
	local success, info = pcall(function()
		return marketplaceService:GetProductInfo(itemId, Enum.InfoType.Asset)
	end)

	return success and info or nil
end

local accessoryCategories = {
	"Face", "Head", "LeftArm", "LeftLeg", "RightArm", "RightLeg",
	"Torso", "GraphicTShirt", "Pants", "Shirt",
	"BackAccessory", "FaceAccessory", "FrontAccessory", "HairAccessory",
	"HatAccessory", "NeckAccessory", "ShouldersAccessory", "WaistAccessory"
}

local function getAccessoryIds(category, humanoidDescription)
	local accessoryValue = tostring(humanoidDescription[category])
	local split = accessoryValue:split(",")
	local ids = {}

	for _, itemId in ipairs(split) do
		table.insert(ids, tonumber(itemId))
	end

	return ids
end

I might be doing it wrong, this is my first attempt at doing this kind of stuff

1 Like

On the Roblox Documentation for HumanoidDescription, AccessoryBlob is marked as non-scriptable, meaning scripts aren’t allowed to read or write this variable.
In addition, AccessoryBlob is unlike other variables in HumanoidDescription, as it is a Json in string format.

One way to access the Characters Layered Clothings through HumanoidDescription, is via HumanoidDescription:GetAccessories(includeRigidAccessories), which returns only the Layered Clothing, in an Array.
Output of GetAccessories(false) would look like so:

{
  [1] = {
     ["AccessoryType"] = Pants,
     ["AssetId"] = 6984740059,
     ["IsLayered"] = true,
     ["Order"] = 2
  },
  [2] = {
     ["AccessoryType"] = Jacket,
     ["AssetId"] = 7192549218,
     ["IsLayered"] = true,
     ["Order"] = 4
  },
  [3] = {
     ["AccessoryType"] = TShirt,
     ["AssetId"] = 9112474888,
     ["IsLayered"] = true,
     ["Order"] = 3
  },
  [4] = {
     ["AccessoryType"] = LeftShoe,
     ["AssetId"] = 9614836327,
     ["IsLayered"] = true,
     ["Order"] = 0
  },
  [5] = {
     ["AccessoryType"] = RightShoe,
     ["AssetId"] = 9614841343,
     ["IsLayered"] = true,
     ["Order"] = 1
  }
}

If you plan on getting and setting the accessories of the HumanoidDescription, I reccomend using GetAccessories() and SetAccessories(), with the includeRigidAccessories set to true, to include any non-layered clothing.