Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Get Shirt Template ID with Shirt ID?

Hello everyone!

Please delete this if not allowed; I am trying to create a GUI that allows someone to enter a shirt ID. Using that, it puts it on their character. I wrote a script that works, but it puts on some random shirt because the shirt ID doesn't match the Shirt Template ID. Does anyone know how to get around this?

e.g,

-- shirtId is input from the player
local shirt = Instance.new("Shirt")
shirt.Parent = player

shirt.ShirtTemplate = http://www.roblox.com/asset/?id= .. shirtId

1 answer

✓ Accepted answer

You can use InsertService to create a shirt with the shirtId and copy its template Id.

local shirt = Instance.new("Shirt")
shirt.Parent = player
local asset = game:GetService("InsertService"):LoadAsset(shirtId)

shirt.ShirtTemplate = asset:FindFirstChildOfClass("Shirt").ShirtTemplate

asset:Destroy()

1 comment

1

Thanks!!

This discussion is preserved as it was. New answers, comments, and votes are closed.