I want to put a shirt asset on a MeshPart using a LocalScript, but im not sure how i could convert the shirt id to a texture id
I’ve tried using MarketplaceService but its not working
Here’s the script
script.Parent.customizemenu.shirt.Text = "invalid, must be a number"
wait(1)
script.Parent.customizemenu.shirt.Text = oldshirt
return
end
local MPS = game:GetService("MarketplaceService")
local ye, Info = pcall(MPS.GetProductInfo, MPS, script.Parent.customizemenu.shirt.Text)
if ye then
if Info.AssetTypeId == 11 or Info.AssetTypeId == 13 then
game.ReplicatedStorage.arms.clothing.leftshirt.leftshirt.TextureID = string.format("rbxassetid://",Info.AssetId)
game.ReplicatedStorage.arms.clothing.rightshirt.rightshirt.TextureID = string.format("rbxassetid://",Info.AssetId)
else
script.Parent.customizemenu.shirt.Text = "nice try but it isnt a shirt or a decal"
end
else
script.Parent.customizemenu.shirt.Text = "invalid id"
wait(1)
script.Parent.customizemenu.shirt.Text = oldshirt
end```
how would i do it using a localscript though
the id i sent is the one i used for testing
what im doing here is a system where you put the shirt id and then it’s going to be applied to a viewmodel
Insert a “Shirt”/“Pants” instance in studio and then paste the catalog ID into its “Template” property, the ID will be automatically updated into the corresponding asset ID.
You’re in luck, I researched this recently. If you own the asset then you can insert it with InsertService and read the .Texture property (or equivalent for shirts, I don’t know off the top of my head), if not then unfortunately you don’t really have a solution. There is no way to get it, but a potential workaround is to:
Subtract 1 from the CatalogID
Check if asset is created by the user setting the decal
If yes, then use that
If no, then repeat the above
There is sadly not a proper method for this, but in the meantime you can support this feature request for it. In future please use the search feature, as there are a lot of topics similar to this.