Clone erroring?

  1. **What do you want to achieve?**I want to make a players character Clone.

  2. What is the issue? image

  3. What solutions have you tried so far? Youtube

game.Players.PlayerAdded:Connect(function(plr)
	print(plr.Name)
	for i,v in pairs(game.Players:GetChildren())  do
		print(v.Name)
		if game.Players:FindFirstChild(v.Name) then
			v.Character:Clone()
			
		end
	end	
	--local p3 = plr.Character
	--local body = p3
	--body:Clone()
	--body.Parent = game.workspace


end)

Do game.Players:GetPlayers() :GetChildren() in the Players Service gets the Backpack and PlayerGui etc. GetPlayers only gets the player

Also set the

v.Character:Clone().Parent = --parent

Can you write it in the script, its a bit confusing

Ok here :slight_smile: :slight_smile:

game.Players.PlayerAdded:Connect(function(plr)
	print(plr.Name)
	for i,v in pairs(game.Players:GetPlayers())  do
		print(v.Name)
	    v.Character:Clone()
	end	
	--local p3 = plr.Character
	--local body = p3 --are you getting the torso or the humanoid root part?
	--body:Clone()
	--body.Parent = game.workspace
end)

hmm… Still is giving me the same error. Just so you know this is a server script not local.

Oh ok I might know try this:

local char = v.Character or v.CharacterAdded:Wait()
char:Clone()
char.Parent = --parent // Set it's parent or it will not clone

Not working still, its a different error now … it just takes all my animations away

This is what you want:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAppearanceLoaded:Connect(function(char)
		char.Archivable = true
		local duplicate = char:Clone()
		
		if duplicate then
			duplicate.Parent = workspace
		end
		char.Archivable = false
		
	end)
end)
1 Like

Well the why use

for i,v in pairs(game.Players:GetPlayers()) do -- you already have the plr
1 Like

Oh wait someone got it to work for me, thank you a lot though!

1 Like

One Problem, I only want one duplicate for each server. I just want the dummy to change the the characters appearance kind of like Piggy in the cutscenes.

local CharacterClone = {}

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAppearanceLoaded:Connect(function(char)
		if CharacterClone[plr] then
			CharacterClone[plr]:Destroy()
		end
		char.Archivable = true
		CharacterClone[plr] = char:Clone()
		
		if CharacterClone[plr] then
			CharacterClone[plr].Parent = workspace
		end
		CharacterClone[plr].Archivable = false
	end)
end)

game.Players.PlayerRemoving:Connect(function(plr)
	if CharacterClone[plr] then
		CharacterClone[plr]:Destroy()
	end
end)