Why doesn't my character clone accessories?

game:GetService('Players').PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(character)
		local function cloneCharacter(character)
			character.Archivable = true
			local cloned = character:Clone()
			character.Archivable = false
			return cloned
		end
		
		if game:GetService('ReplicatedStorage'):FindFirstChild(plr.Name) == nil then
			local cloned = cloneCharacter(character)
			cloned.Name = plr.Name
			cloned.Parent = game.ReplicatedStorage
			cloned.HumanoidRootPart.CFrame = workspace.SpawnLocation.CFrame
		end
		
		character:WaitForChild('Humanoid').Died:Connect(function()
			if plr.TeamName.Value == 'Player' and plr.Revived.Value == false then
				local clone = revivePart:Clone()
				clone.Parent = game.Workspace:FindFirstChild(chosenMap.Value)
				clone.Position = character.HumanoidRootPart.Position
				clone.Name = plr.Name
				clone.ProximityPrompt.ObjectText = plr.Name
				
			end
			plr.TeamName.Value = 'None'
		end)
	end)
end)

Basically the title. When I replace the player’s character with the clone, it only clones body colors and scripts and parts, but doesn’t clone accessories. How would I fix that? Thank you!

2 Likes

Some characters may load longer than others, so add a wait somewhere in your script. Something along these lines (you can test and experiment with it)

local char = plr.Character or plr.CharacterAdded:Wait()
wait(char)
1 Like

plr.Character is a refernce to the player’s character and plr.CharacterAdded:Wait() returns the player’s character after yielding untils its added. You don’t need to do wait(char) as it’s already done by plr.CharacterAdded:Wait()

You should use a RunService.Stepped:Wait() (which is soon going to become RunService.PreSimulation, theres a bunch of posts about that) to wait for a bit so accessories can load in.

1 Like

Thanks, but the forcefield is on permanently, so I fixed that by just disabling the spawn location forcefield.