The shirt and pants are part of the character model and not the player instance. In addition, you need to change the ShirtTemplate property of the shirt. This would like this:
script.Parent.MouseButton1Click:connect(function()
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()
local Shirt = "http://www.roblox.com/asset/?id=128133687"
local Pants = "http://www.roblox.com/asset/?id=128133700"
if char:FindFirstChild("Shirt") then
char.Shirt.ShirtTemplate = Shirt
else
local newShirt = Instance.new("Shirt")
newShirt.Parent = char
newShirt.ShirtTemplate = Shirt
end
if char:FindFirstChild("Pants") then
char.Pants.PantsTemplate = Pants
else
local newPants = Instance.new("Pants")
newPants.Parent = char
newPants.PantsTemplate = Pants
end
end)
2 comments
What do you mean "It's parent" do you mind giving an example, for instance, a shirt.
Instance.new("Shirt",workspace.Player1)