In roblox, each article of clothing annoyingly contains two separate ids, one for the catalog and another for the shirt template. In roblox studios, to give a humanoid a shirt, one uses the shirt template id. However, players usually use the catalog id when searching for clothes. This isn't much of a problem if a player were to manually insert a piece of clothing to a player as studios automatically converts the catalog id to the template id as soon as enter is pressed, however, if one were to implement a script where a catalog id is inserted, and given to the player as a template id, it would not automatically be converted, thus the player's shirt would not change. Therefore I ask, is there any possible way to convert a catalog id to a template id with reasonable ease without having to scroll through every decal in the library to see if one matches up with the catalog shirt.
COMMUNITY QUESTION
Converting Catalog id to Template id in clothing?
1 answer
You cannot have an existing clothing then put the clothing ID in it even if you use "rbxassetid://" that wouldn't work. Instead you need to use LoadAsset[https://wiki.roblox.com/index.php?title=API:Class/InsertService/LoadAsset]. Here is a script
local plr = game:GetService("Players")["PLAYER NAME HERE"]
local model = nil
local succ, err = pcall(function()
model = game:GetService("InsertService"):LoadAsset(CLOTHING ID HERE)
end)
if succ then
if model:FindFIrstChild("Shirt") then
model:FindFIrstChild("Shirt").Parent = plr.Character
model:Destroy()
end
else
warn("Could not load clothing. Error: " .. err)
end
2 comments
0
Changing the id of an existing clothing does work, however, you need to insert the template id rather than the catalog id, But ok, I'll try the load asset method
0
But looking again, I would rather find a way to convert catalog id to to template id as it would be much easier and won't involve bringing random models and it'll also allow easier change of clothing
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
I recommend using the insertservice for this, it loads an asset (inside a model) using the id https://wiki.roblox.com/index.php?title=API:Class/InsertService/LoadAsset
Are you sure it works with shirts? Such as in Player.Character.Shirt.ShirtTemplate = ____