Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I fix this ID glitch?

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.

3 comments

0

Well when I put down a ID in studio Another Shirt popped out.

0

Try subtracting the ID again, sometimes when uploading a shirt, another will be uploaded at the same time, heres what I mean; Your Shirt (1) > Someones Elses (2) > Full Shirt (3) > Someones Full Shirt (4).

0

thanks that worked!

1 answer

✓ Accepted answer

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.

2 comments

0

I didn't ask for a Script.

0

I know. Did the first part explain your problem?

This discussion is preserved as it was. New answers, comments, and votes are closed.