So i have a StarterCharacter and i want to clone the players clothes to the StarterCharacter. i have a script which shows me the clothing items and their id's but i dont know how to grab them in the script just through the output. Here is the script and what it outputs.
local PS = game:GetService("Players") game.Players.PlayerAdded:Connect(function(player) local info = game:GetService("Players"):GetCharacterAppearanceInfoAsync(player.UserId) -- get a table with information about the user's worn assets. takes an user id. local function printTable(t, indent) -- recursively scans the table and prints it indent = indent or "" for k, v in next, t do print(indent .. k, "=", v) if type(v) == "table" then printTable(v, indent .. ">") end end end printTable(info) end)
Is this what you're looking for?
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) wait(0.5) local starterchar = workspace.StarterCharacter local descendants = char:GetDescendants() for index, descendant in pairs(descendants) do if descendant:IsA("Accessory") then local clone = descendant:Clone() clone.Parent = starterchar end end char:WaitForChild("Pants"):Clone().Parent = starterchar char:WaitForChild("Shirt"):Clone().Parent = starterchar char:WaitForChild("Body Colors").Parent = starterchar char.Head:WaitForChild("face"):Clone().Parent = starterchar.Head end) end)