Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I copy a player's skin from their UserId even if they're not in the game?

Asked by
3132750 45
4 years ago

So, I'm trying to copy a player's clothes and body type from their userId even if they are not in the game. This is what I have so far. It works, but not very well. How do I improve?

local Model = game.Players:GetCharacterAppearanceAsync(script.Parent.Parent.id.Value)
for i, v in pairs(Model:GetChildren()) do
    if v.ClassName == "Shirt" or v.ClassName == "Pants" then
        v.Parent = Dummy
elseif v:IsA("BodyColors") then
    v.Parent = Dummy.Humanoid
    elseif v.ClassName == "Accessory" then
        Dummy.Humanoid:AddAccessory(v)
    elseif v.ClassName == "CharacterMesh" then
        v.Parent = Dummy
    end
end

Answer this question