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

Get a Player's Accessories For Custom Rig?

Asked by 4 years ago

So I'm making a custom character rig, and I want to add the player's accessories and shirts. However, using a StarterCharacter won't allow me to put their personal accessories and shirts on the StarterCharacter. Setting the player's character to another model after getting the assets will freeze the camera.

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        local things = char:GetChildren()
        local charClon = game.StarterPlayer.StarterCharacter:Clone()
        charClon.Name = plr.Name
        for i, v in pairs(things) do
            if v:IsA("Accessory") then
                v.Parent = charClon
            elseif v:IsA("Shirt") or v:IsA("Pants") then
                v.Parent = charClon
            elseif v:IsA("BodyColors") then
                v.Parent = charClon
            end
        end
        plr.Character = charClon
    end)
end)

Answer this question