How to get assetId from accessory itself

Hello! I am making a avatar editor (kind of royale high). I ran into a problem where i dont know how to get the player’s character’s accessory’s assetId. all i know is the contentId, but i dont know how to get the ID

New ContentId format for easy thumbnail loading - Updates / Announcements - DevForum | Roblox

character.ChildAdded:Connect(function(child)
    if child:IsA("Accessory") then
        local itemFrame = buttonsContainer.itemFrame:Clone()
        itemFrame.Parent = script.Parent --frame
        itemFrame:FindFirstChild("TextLabel").Text = child.Name
        itemFrame.ImageLabel.Image = "https://www.roblox.com/asset-thumbnail/image?assetId="..[ASSET ID].."width=420&height=420&format=png" --URL to get the thumbnail
    end
end)

You can’t get the accessory’s assetId from the accessory itself, you need to get it from the HumanoidDescription of the player.

2 Likes

how can i separate arrays like this though?

local property = HumanoidDescription["HatAccessory"]
local ids = property:split(",")
print(ids)

Ids will be a table of all of the ids in that property.

2 Likes