How to detect if an marketplace item ID is Content Deleted?

I have a game with thousands of marketplace IDs, whereas I need to check which ones got deleted, I am asking for a way that is not manual but some automatic script.

Because doing it all manually, wouldn’t be effective at all, and maybe I wouldn’t even find all of the deleted stuff.

The IDs are not directly in script, but in “HumanoidDescription”. That might complicate things a bit.

I tried checking if some solution for this already exists, but found nothing.

You should use InsertService.

For example, using this code:

game:GetService("InsertService"):LoadAsset(theAssetID).Parent = workspace

If using LogService you see ‘Asset is not approved for the requester’ the item is deleted.

But this would mean I would have to put manually all the IDs into the script, which is not very helpful.

I don’t know if I’m doing what you mean, but ‘HumanoidDescription’ has values for each accesory type. You could place the values via a script inside the code I gave automatically.

Run this script in your Command Bar:

local InsertService = game:GetService("InsertService")

--[[ Define what properties to check, without the "Accessory" at the end]]
local toCheck = {"Back", "Face", "Front", "Hair", "Hat", "Neck", "Shoulders", "Waist"}

--[[ Store ID's that couldn't be loaded]]
local errored = {}

--[[ Where are your folders with characters stored?]]
--[[ For example, this path would with with this kind of setup:
ReplicatedStorage
    Outfits
        Section1
            Character
            Character
        Section2
            Character
]]
local charactersPath = game.ReplicatedStorage.Outfits

for _, folder in ipairs(game.ReplicatedStorage.Outfits:GetChildren()) do
    for _, model in ipairs(folder:GetChildren()) do
        local description = model:FindFirstChildWhichIsA("HumanoidDescription")
        if not description then continue end
        
        for _, property in ipairs(toCheck) do
            local strings = tostring(description[property.."Accessory"]):split(",")
            for _, str in ipairs(strings) do
                local numericString = str:gsub("%D", "")
                if #numericString <= 0 then continue end
                
                local id = tonumber(numericString)
                
                local s, e = pcall(InsertService.LoadAsset, InsertService, id)
                if not s then
                    game:GetService("Selection"):Add({description})
                    warn(string.format("Asset with ID: %d\nAt: %s\nError: %s", id, description:GetFullName(), e or "Unknown"))
                    
                    if table.find(errored, id) then continue end
                    table.insert(errored, id)
                else
                    e:Destroy()
                end
            end
        end
    end
end

print("List of unavailable accessories:")
for _, id in ipairs(errored) do print(id) end
  • It will tell you what ID’s can’t be retreived, where they’re located and what the error was.
  • It will also select the HumanoidDescription that contains said ID.
  • At the end, it tells you the summary of all ID’s that cannot be loaded.
  • All Output will be in the Output window.
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.