so i want to get the asset ID’s of the accessories a player is wearing, and i ALSO want to get the accessory’s children too. How would I go about doing both in the same function?
okay so a humanoid has this instance called HumanoidDescription which has all of the accessory equipped, bodyparts, body color, animation, clothes, so that’s the first thing you should check out/
local accessories = {}
local players = game:GetService("Players")
players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(character)
for _, child in ipairs(character:GetChildren()) do
if child:IsA("Humanoid") then
local humanoidDescription = child:WaitForChild("HumanoidDescription")
accessories = humanoidDescription:GetAccessories(true)
end
end
for _, tables in pairs(accessories) do
for i, v in pairs(tables) do
if i == "AssetId" then
print(v)
end
end
end
end)
end)
This will get the assetId’s of accessories.
1 Like