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

How to copy a players bodycolor, shirt, pants, accessories and character meshes?

Asked by 4 years ago

So I am trying to make a "Copy" of the character, but the "Copy" is a ragdoll. it works and when you die it appears, but it is a blank character model and no face, accessories, bodycolor, or character meshes:

there are no errors or warnings

Script:


function cloneCharacter(character) local basehumanoid = game.ServerStorage.Dummy:Clone() for _,child in pairs(character:getChildren()) do print("current focus:", child.Name) if child.Name == "Head" then for _,v in pairs(child:getChildren()) do if v:IsA("SpecialMesh") then local clone = v:Clone() clone.Parent = basehumanoid.Head print("transfering:", v.Name) end if v:IsA("Decal") then local clone = v:Clone() clone.Parent = basehumanoid.Head print("transfering:", v.Name) end end end local clone = character["Body Colors"]:Clone() clone.Parent = basehumanoid for _,acc in pairs(character.Humanoid:GetAccessories()) do local clone = acc:Clone() clone.Parent = basehumanoid end end basehumanoid.Name = character.Name basehumanoid.Parent = game.ServerStorage.Ragdolls end game:GetService('Players').PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) cloneCharacter(character) character:WaitForChild("Humanoid").Died:Connect(function() local clone = game.ServerStorage.Ragdolls[player.name]:Clone() print(clone.Parent) clone.Parent = game.Workspace character:Destroy() wait(5) player:LoadCharacter() end) end) end)

Answer this question