Hello!

I am trying to figure out how I can get the template id from a clothing id.

My repeat loop ends after only one subtraction, meaning that it ends with shirtID equaling 2574442245, when it should continue until it finds a matching userId to the creator of the shirt.

local marketplace = game:GetService('MarketplaceService')

local shirt = character:WaitForChild('Shirt')
local shirtID = 2574442246
local shirtInfo = marketplace:GetProductInfo(shirtID)
local shirtCreatorID = shirtInfo.Creator.CreatorTargetId
        
repeat 
    shirtID = shirtID - 1 
    wait() 
until 
    shirtCreatorID == shirtCreatorID  
        
shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=".. shirtID

2 comments

1

MarketplaceService has a function I believe

0

You put me on the right track, but now I'm having more trouble.