I am making a closet with several pieces of clothing (shirts, pants, and t-shirts specifically). One problem I am having is that when a player switches out their clothing for the one on a rack it shows their old clothing as the clothing's template instead of the thumbnail of the clothing (I have a function to take an asset id and return a thumbnail url). I've searched around on Google and I've looked into some of Roblox's web apis, but I have not found any solution. Is there any http request I could make or built in function I could use to get a shirt asset id from a template id?
My last resort would be to not use the asset at all and just use the template asset id.
All help is greatly appreciated.

3 comments
Maybe try a substring with the shirt image to extract just the numbers and then use tonumber() and add 1?
That does appear to work. Thank you for your help (and I do have a function already setup to extract asset ids from urls).
Try and subtract 1 in lieu of adding 1. But sometimes a formula wouldn't work, because there may be cases where you have to subtract by 2+.