basically, i have a script that copies a players Humanoid Description and applies it to itself, however it only copies the body colors and hats.how could i make it copy the shirts, pants, etc.
this is the code im using to get the Humanoid Description and apply it, this is in a server script and R6.
local HumanoidDescription = target.Parent.Humanoid:GetAppliedDescription()
humanoid:ApplyDescription(HumanoidDescription)
local Character = -- The Character
local Outfit = {}
function CloneOutfit()
for i, v in ipairs(Outfit) do
local Cloth = Outfit[i]:Clone()
Cloth.Parent = -- Character it's cloning to
end
Outfit = {}
end
for i, v in ipairs(Character:GetChildren) do
if v:IsA("Shirt") or v:IsA("Pants") or v:IsA("Acessory") then
table.insert(Outfit, v)
end
end
CloneOutfit()
Doesnt seem to change anything, here is the full function im using:
local CloneCharacterDebounce = false
function checkSight(target)
local ray = Ray.new(humanoidrootpart.Position, (target.Position - humanoidrootpart.Position).Unit * 50)
local hit,position = workspace:FindPartOnRayWithIgnoreList(ray, {script.Parent})
if hit then
if hit:IsDescendantOf(target.Parent) and math.abs(hit.Position.Y - humanoidrootpart.Position.Y) < 3 then
local Distance = (humanoidrootpart.Position - target.Position).Magnitude
if Distance < 4 and not humanoid.Parent.Stunned.Value and not CloneCharacterDebounce then
CloneCharacterDebounce = true
local Character = target.Parent -- The Character
local Outfit = {}
local function CloneOutfit()
for i, v in ipairs(Outfit) do
local Cloth = Outfit[i]:Clone()
Cloth.Parent = Character-- Character it's cloning to
end
Outfit = {}
end
for i, v in ipairs(Character:GetChildren()) do
if v:IsA("Shirt") or v:IsA("Pants") or v:IsA("Accessory") then
table.insert(Outfit, v)
end
end
CloneOutfit()
--local HumanoidDescription = target.Parent.Humanoid:GetAppliedDescription()
--humanoid:ApplyDescription(HumanoidDescription)
target.Parent.Humanoid.Health = 0
task.wait(1)
CloneCharacterDebounce = false
end
foundtarget = 1
return true
end
end
return false
end
the debounce is there as this function runs in a Runservice.Heartbeat loop