Hat Placement Automation

Hello,
I want to create a game that has every single ROBLOX accessory.
My plan is to make a script that will scrape every single accessory ID, and create a dummy, which will wear the hat.

Is this possible?

loading hats from the catalog through InsertService or AssetService will provide you with the Accessory instance for the hat, placing that hat into a character model will automatically adjust the hat to where its supposed to be
in the scenario it doesnt, i believe the accessory weld inside a hat just sets C0 to the hat attachment’s CFrame.Position and sets the C1 to the character’s hat attachment CFrame.Position

probably explained this poorly but hopefully the idea gets across…

In theory, yes, but I haven’t tried it, so I can’t be sure. Keep in mind that there are banned IDs, and simply specifying a range of 1-? probably won’t work.

I found this script that uses Roblox API to get accesory IDs:

local function FetchAccessories(cursor)
    local url = "https://catalog.roblox.com/v1/search/items/details"
    local body = {
        Category = 11,      
        Subcategory = 9,   
        Limit = 30,          -- max is 30
        Cursor = cursor      -- Parameter for the next page
    }
    local jsonBody = HttpService:JSONEncode(body)
    local headers = {
        ["Content-Type"] = "application/json"
    }
    local response = HttpService:PostAsync(url, jsonBody, Enum.HttpContentType.ApplicationJson, false, headers)
    local data = HttpService:JSONDecode(response)
    return data
end

I hope this helped, I think you definitely need to use the API to get all the IDs, but I don’t think the server will handle that many requests quickly.

To load hat in the game use InsertService or AssetService.

Thank you , im definitely going to look into doing something like this.