When Putting a ID for Shirts and Pants I would Subtract a 1 from the Shirt ID. But when I Subtracted 1 from a ID it become another Shirt. What had happened here? Please Reply.
Most of the time, when you upload a shirt, the shirt image's ID is 1 less, but if multiple people created assets at around the same time, it could have an earlier ID. Keep on subtracting 1 until you find it.
If you want to do this automatically in a game, you can use MarketplaceService's GetProductInfo method to iterate backwards until you find it.
local MarketplaceService = game:GetService("MarketplaceService") local ShirtID = 114883953 local CreatorName = MarketplaceService :GetProductInfo(ShirtID).Creator.Name local ImageID = nil for i = 1, 20 do local info = MarketplaceService :GetProductInfo(ShirtID - i) print(info.Name) if (info and info.Creator.Name == CreatorName) then ImageID = ShirtID - i break end end if (ImageID == nil) then print("Image not found for Shirt") else print("Found ImageID") end
Note: This will not work with Group shirts, because the image was uploaded by a user but the shirt is owned by the group.