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

how do i get the local player's appearance from website and paste accessories into dummy on load ?

Asked by 3 years ago

i have code here that can get the players appearance from the game because since my game uses a Starter Character it only loads data from there. in trying to write a piece of code that gets the original roblox avatar, loads it onto a dummy and then pastes SkinColour, face decal and accessories into the players character

local bin = script.Parent
local config = bin.Config

local accessories = config.addAccessories
local clothing = config.addCloth
local face = config.addFace
local shape = config.addBodyShape
local color = config.addColor
local t = config.addT

local delayTime = 2.5

game.Players.PlayerAdded:Connect(function(plr)
    wait(delayTime)
    local h = plr.Character

    if (h:FindFirstChild("Pants") and h:FindFirstChild("Shirt")) and clothing.Value==true then
        h:WaitForChild("Pants"):Clone().Parent = bin
        h:WaitForChild("Shirt"):Clone().Parent = bin
    end
    for i, v in pairs(plr.Character:GetChildren()) do
        if v:IsA("Accessory") and accessories.Value==true then
            v:Clone().Parent = bin
        elseif v:IsA("BodyColors") and color.Value==true then
            v:Clone().Parent = bin
        elseif v:IsA("ShirtGraphic") and t.Value==true then
            v:Clone().Parent = bin
        end
    end

    if h.Head:FindFirstChild("face") and face.Value==true then
        bin.Head.face.Texture = h.Head:WaitForChild("face").Texture
    end

    for i,v in pairs(h.Humanoid:GetChildren()) do
        if (v:IsA("HumanoidDescription") or v:IsA("NumberValue")) and shape.Value==true then
            v:Clone().Parent = bin.Humanoid
        end
    end

    bin.Name = h.Name
end)

Answer this question