Honsestly, this seems like one of those things that seem so easy on paper then I try to do it then it just doesnt work out.
I am trying to delete the players shirt (If they have one) then create a new one. All I get it a new shirt instance but the shirt doesnt even show up. I made sure the id is valid. The id I used for this is 3670737444.
script.Parent.OnServerEvent:Connect(function(plr, itemtype, id) -- On server event
if itemtype == "2DShirt" then -- If it should be changing shirt
local hmd = plr.Character.Humanoid.HumanoidDescription -- humanoid desc
local char = plr.Character -- character
for i, v in pairs(char:GetChildren()) do -- deleting current shirt
if v:IsA("Shirt") then
local s = Instance.new("Shirt") -- making new shirt
s.ShirtTemplate = "http://www.roblox.com/asset/?id=" .. id -- 3670737444
s.Name = "Shirt" -- Naming the shirt
s.Parent = char -- Setting the shirts parent
hmd.Shirt = id -- Setting humanoid desc shirt to id
script.Parent.OnServerEvent:Connect(function(plr) -- On server event
if plr.Character:FindFirstChild("Shirt") then
plr.Shirt.ShirtTemplate = "rbxassetid://3670737444"
local shirt = Instance.new("Shirt")
shirt.Parent = plr
shirt.ShirtTemplate = "rbxassetid://3670737444"
IDs you take from the browser link on the avatar shop don’t work if you put them in shirttemplate from a script. To get the real Id, that will work from a script, make a shirt in the studio itself, and put your link into it’s shirt template. You’ll notice that some numbers of the ID change. That’s the ID you need to use in the script
IDs you take from the browser link on the avatar shop don’t work if you put them in shirttemplate from a script. To get the real Id, that will work from a script, make a shirt in the studio itself, and p
You want to give it to player, or dummy ? Because if you want to give it to every player, you can use game settings for it. In game settings, go to avatar, then scroll down to clothing section, select which clothing you want to overwrite and give it the ID if the clothing.