Help with weird bug or glitch ( Clothes)

Hello, probably not the right category, anyway So

This is my script:

game.Players.PlayerAdded:Connect(function(Player)
	if Character:GetAsync(Player.UserId) then
	Player.CharacterAdded:Connect(function()
		local data = pcall(function()
	Character:GetAsync(Player.UserId)
	end)
	if data then
		
		local CharacterOOf = Player.Character or Player.CharacterAdded
		CharacterOOf.Humanoid.Health = -102
wait(0.3)
CharacterOOf.Humanoid.Health = 100
		local dataxd = Character:GetAsync(Player.UserId)
		for i,v in pairs(CharacterOOf:GetChildren()) do
			if not v:IsA("Shirt") and not v:IsA("Pants") and v:IsA("CharacterAppearance") or v:IsA("Accessory") then
				v:Destroy()
		end
		end
		print(dataxd.HairName)
		game.ReplicatedFirst.Hairs:WaitForChild(tostring(dataxd.HairName)):Clone().Parent = CharacterOOf
		local Shirt = CharacterOOf:WaitForChild("Shirt")
		Shirt.Parent = CharacterOOf
		Shirt.Name = "Shirt"
		Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..dataxd.ShirtId
		local Pants = CharacterOOf:WaitForChild("Pants")
		Pants.Parent = CharacterOOf
		Pants.Name = "Pants"
		Pants.PantsTemplate = "http://www.roblox.com/asset/?id="..dataxd.PantsId
		for i,v in pairs(CharacterOOf:GetChildren()) do
			if v:IsA("MeshPart") or v:IsA("Part") or v:IsA("UnionOperation") or v:IsA("BasePart") then
				v.BrickColor = BrickColor.new(dataxd.SkinColor)
			end
		end
	elseif not data then
		game:GetService("TeleportService"):Teleport(Player, 4530548451)
	end

	end)
	end
end)

It works 100% Fine. But I have a trouble, the shirts I use, aren’t mines, are just some shirts I have on my inventory, if I use them like playing a Game It works, but when I try to set character shirt.
ShirtTemplate to any of the shirts, it says failed to load rbxassetid.

Your question is slightly worded oddly. The Shirt IDs you should be using aren’t the same as what you see on the website. You would need to use InsertService to properly set the shirt and pants using the ID you see on the website. You could use this method to get this done. However, instead of parenting the asset, you would set Shirt.ShirtTemplate to what SteadyOn says towards the end of his answer.

1 Like