Ok so now I have a serverscript inside of a part with the click detector and the id value. The instance is in the character, but doesn't display on the character.
local part = script.Parent
local detector = part.ClickDetector
local id = part.Id
clothingType = "Pants" --Change to "Pants" or "Shirt"
detector.MouseClick:Connect(function(player)
if player.Buy.Value == true then
else
local char = workspace:FindFirstChild(player.Name)
local findClothing = char:FindFirstChild(clothingType)
if findClothing then
findClothing:Destroy()
if clothingType == "Shirt" then
local newShirt = Instance.new("Shirt")
newShirt.Name = "Shirt"
newShirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..id.Value
newShirt.Parent = char
elseif clothingType == "Pants" then
local newPants = Instance.new("Pants")
newPants.Name = "Pants"
newPants.PantsTemplate = "http://www.roblox.com/asset/?id="..id.Value
newPants.Parent = char
end
else
if clothingType == "Shirt" then
local newShirt = Instance.new("Shirt")
newShirt.Name = "Shirt"
newShirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..id.Value
newShirt.Parent = char
elseif clothingType == "Pants" then
local newPants = Instance.new("Pants")
newPants.Name = "Pants"
newPants.PantsTemplate = "http://www.roblox.com/asset/?id="..id.Value
newPants.Parent = char
end
end
end
end)

6 comments
er, whats your issue here?
well, you can get the character directly from the player instance (player.Character). hope that helps
try using "rbxassetid://[id]" instead of "http://www.roblox.com/asset/?id=[id]"
i tried that it didnt work
even tried insertservice
the issue is that the clothes wont show up