How to get the Shirt ID from the Template ID?

How could I fetch the Shirt ID from just the Template ID through a script?

I know how to get the Template ID from the Shirt ID, but I am wondering how I can reverse this.

For example, I have a template ID (5706174468) and I want to find the Shirt ID through a script. How can this be done?

Any feedback is appreciated. :slight_smile:

1 Like

Try using InsertService?

game:GetService('InsertService'):LoadAsset(5706174468).Parent = workspace

That line should parent it to workspace.

1 Like

That will create a decal image of the shirt template, but it still does not give me the ID of the shirt that it is the template for. :confused:

1 Like

Oh, I think I see your issue. I went to the link and it’s a decal of the shirt template, you can just apply that to your shirt item like this:

local myShirt = workspace.Shirt
local myID = 5706174468
myShirt.ShirtTemplate = 'rbxassetid://'..myID

That should work.

1 Like

Yes that would work. But what I am trying to do is sell the shirt to the user with the template ID, and to do that I would need the Marketplace Shirt ID, not template. But, I do not know how to find the shirt ID based on just the template ID if that makes sense.

1 Like

Ohhh, got it! Thanks for the info. I’ll try and look into that.

1 Like

I wasn’t able to get that, however the first code sample here might work:

1 Like

Erm I figured it wouldn’t really be possible, just wanted to see if there was something I was missing. Thanks for your help!

1 Like