:Clone() not working in local script

I used this source code in the studio and it clones the model of a player correctly:

local player = game.Players.LocalPlayer
local charac = workspace:WaitForChild(player.Name)
charac.Archivable = true

local clone = charac:Clone()
if not clone:FindFirstChild("HumanoidRootPart") then
	repeat
	    charac = workspace:FindFirstChild(player.Name)
		clone = charac:Clone()
		wait(0.1)
	until clone:FindFirstChild("HumanoidRootPart")
end
clone.Parent = workspace
clone.PrimaryPart = clone:FindFirstChild("HumanoidRootPart")
clone:MoveTo(Vector3.new(19.581, 3.15, 25.422))
2 Likes