how do i get an template id from an id with a script
You have to elaborate with what you want to achieve
If you want to add an id to something like a decal you can do this
Decal.Texture = "rbxassetid://".. TextureIdGoesHere
I assume you’re trying to convert a catalog id to an asset id, if so then the following reply is what you’re looking for:
However, you must change 2 things:
-
assetId-i
instead ofassetId+i
-
return sameCreator
instead ofreturn isDecal and sameCreator
If you just want to display the image in-game without fetching the id then you can use the thumbnail endpoint as shown here:
Where userInput
is your decal/catalog id
but @lazerwolf11 and @NyrionDev look for a sec in the code and tell me how is it possible to get the template id
game.ReplicatedStorage.Shirts.OnClientEvent:Connect(function(shirts)
for i, v in pairs(shirts) do
local marketplace = game:GetService("MarketplaceService")
local ImageId = "rbxthumb://type=Asset&id=" .. v.Id .. "&w=420&h=420"
local namestring = script.Temp:WaitForChild("name")
local imageidstring = script.Temp:WaitForChild("imageid")
local Cost = v.Price
local nameofshirt = v.Name -- Fixed variable name
local shirt = game.Workspace.STORE.shirts.shirt1["Uniform Giver"].Coathanger:WaitForChild("Shirt")
imageidstring = ImageId
namestring = nameofshirt
local Temp = script.Temp:Clone()
Temp.Parent = script.Parent
Temp.Shirt.Image = ImageId
Temp.name.Text = nameofshirt -- Fixed property name
Temp.Price.Text = Cost .. " robux"
Temp.Name = v.Id
Temp.Shirt.MouseButton1Click:Connect(function()
--when you click on the shirt it will display it on a 3d model
shirt.ShirtTemplate = "rbxassetid://" .. v.Id
end)
end
end)