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

01game.Players.PlayerAdded:Connect(function(plr)
02    plr.CharacterAdded:Connect(function(char)
03        local things = char:GetChildren()
04        local charClon = game.StarterPlayer.StarterCharacter:Clone()
05        charClon.Name = plr.Name
06        for i, v in pairs(things) do
07            if v:IsA("Accessory") then
08                v.Parent = charClon
09            elseif v:IsA("Shirt") or v:IsA("Pants") then
10                v.Parent = charClon
11            elseif v:IsA("BodyColors") then
12                v.Parent = charClon
13            end
14        end
15        plr.Character = charClon
16    end)
17end)

Answer this question