Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I get a shirt's asset id from its template asset id?

Asked by 10 years ago

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.

0
Maybe try a substring with the shirt image to extract just the numbers and then use tonumber() and add 1? FearMeIAmLag 1161 — 10y
0
That does appear to work. Thank you for your help (and I do have a function already setup to extract asset ids from urls). cjcool12345 58 — 10y
0
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+. Redbullusa 1580 — 10y

Answer this question