try using a CharacterAdded function, then give it a wait() so roblox can detect it fully
local Char = script.Parent
local Hum = Char.Humanoid
Char.Humanoid.BreakJointsOnDeath = false
Char.Humanoid.RequiresNeck = false
Char.Archivable = true
Hum.Died:Connect(function(player)
local CharClone = Char:WaitForChild("Part"):Clone()
CharClone.Parent = workspace
CharClone.Anchored = true
wait(4)
CharClone.Parent = player.Character or player.CharacterAdded:Wait()
CharClone.CFrame = CFrame.new(player.Character.Torso.Position)
CharClone.Anchored = false
local Y = Instance.new("Weld")
Y.Part0 = player.Character.Torso
Y.Part1 = CharClone
Y.Parent = Y.Part0
end)