Getting shirt template for ID

Dummy.Shirt.ShirtTemplate = 'rbxassetid://' .. v -- v == 4072782932

Image “https://assetdelivery.roblox.com/v1/asset?id=4072782932” failed to load in “Workspace.CustomiseRoom.Dummy.Humanoid.Clothes”: Request failed
Not sure why this isn’t working as I swear I’ve done this before and it worked fine. I also just tried setting it to v, but that just pasted the ID into the shirt and did nothing.

When I paste the shirt ID into a shirt manually it works and converts it all into the right stuff. But doing it via code isn’t working.

Please don’t just say ‘find the template id yourself’ or anything like that. I need to get the template ID just from the shirts ID and that’s it. If I have hundreds of shirts to go through I’m not wasting extra time looking for their templates, nor am I gonna paste them into a shirt, copy the template id, and then reverse engineer it all.

2 Likes

The id you’re using is a reference to a shirt object, not the image itself. From the devhub, heres a method of finding the image:

local webURL = "https://www.roblox.com/catalog/1804747/White-Shirt"
local assetId = tonumber(string.match(webURL, "%d+") or 0) -- extract the number
local success, model = pcall(function() 
	return game:GetService("InsertService"):LoadAsset(assetId) 
end)
if success then 
	model.Parent = workspace
end

You can then do model:GetChildren()[1].ShirtTemplate to find the image id of the inserted shirt.

5 Likes

This won’t work from the client (LoadAsset)

Is there anyway to do this from the client? Don’t really wanna have to go to ther server to create every single shirt

Not sure why you’re trying to do this on the client? Run a loop of that on the server to get the id of each shirt you’re going to use, store the list somewhere on the client then just reference that if it’s what you’re after.

1 Like

Using client as it’s creating a UI. UI shows the clothing options, clicking a button changes the clothing on a dummy model. Dummy model is only loaded on the client, as each player can change what their dummy looks like

Just run the loop/setup on the server and store all of the ids in replicated storage so that the client can view the values.

As I said. You have a list of Shirts, run a loop in studio once to get their ShirtTemplate IDs, print this list into the output and then store it in a clientside value or script for use at runtime.

This has been a work around for me… I was able to work around it by using the HumanoidDescriptions since you can put the actual shirt ID in them…

In my application, I was making a homestore that would use a proxy to get all of the clothing from the group and automatically put it in the game, since it gives the regular ID and not the template IDs, I had to figure out a way to do it…