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
5 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?

01local Model = game.Players:GetCharacterAppearanceAsync(script.Parent.Parent.id.Value)
02for i, v in pairs(Model:GetChildren()) do
03    if v.ClassName == "Shirt" or v.ClassName == "Pants" then
04        v.Parent = Dummy
05elseif v:IsA("BodyColors") then
06    v.Parent = Dummy.Humanoid
07    elseif v.ClassName == "Accessory" then
08        Dummy.Humanoid:AddAccessory(v)
09    elseif v.ClassName == "CharacterMesh" then
10        v.Parent = Dummy
11    end
12end

Answer this question