Hello, I can’t seem to get an image from an accessory I know you could go to and manually find one image but I’m trying to make something that scans your whole character, gets accessories and puts them on image labels i Really have no idea wear to find an image
Thanks but do you happen know how to get the id from the accessory
game.Players.PlayerAdded:Connect(function(player)
wait(5)
local children = player.Character:GetChildren()
for i, v in pairs(children) do
if v.ClassName == "Accessory" then
local asset = game:GetService("MarketplaceService"):GetProductInfo(v)
print(asset.Name)
end
end
end)
when i do this it says i need an integer so idk how to do it
GetCharacterAppearanceInfoAsync can help you get the ids of those accessories for the images. I’d recommend caching the images for hats you already got previously so it reduces calls to GetProductInfo.
-- Example of caching
local imageCache = {} -- where [accessoryId] = image link
function GetImage(itemId)
if imageCache[itemId] then
return imageCache[itemId]
else
-- call some function to get the image link from GetProductInfo
end
end