Clone every part except humanoidrootpart

this sounds like a dumb question but how do i clone every part in the player’s character EXCEPT the humanoidrootpart?
what i have so far:

			for i,v in pairs(c:GetDescendants()) do
				if v:IsA("BasePart") then
					if v.Name ~= "HumanoidRootPart" then 
						local Cloned = v
						Cloned:Clone()

					end
				end
			end			

Set the character model to Archivable = true first.

The RootPart is essential for some things, what’s your use case?

1 Like

Cell shading, except instead of it being inversed i want it to be transparent, which is why i can’t have certain parts cloned

local character = --path

character.Archivable = true;
local clone = character:Clone();
character.Archivable = false;
clone.PrimaryPart:Destroy();

wouldn’t that work?

for some reason even though my character is archivable, it isnt cloning, also side question what difference does the ; make

Your code doesn’t work because you’re never setting the parent.

It’s also unnecessary to use GetDescendants()

local newChar = Instance.new("Model")

for i,v in pairs(char:GetChildren()) do
   if v.Name ~= "HumanoidRootPart" then
         v:Clone().Parent = newChar
   end
end

newChar.Parent = game.Workspace

Also, using “;” doesn’t make any difference
in other programming languages like C / C# / Java you use that to tell the compiler the line is over and is necessary

in Lua / Luau its optional but provides no performance boost, basically if you’re used to using it its supported but you don’t have to

1 Like

for some reason this kills me.
edit: i’ll try removing the humanoid

still kills me after removing the humanoid

local playersService = game:GetService("Players");

playersService.PlayerAdded:Connect(function(player)
	local char = player.Character or player.CharacterAdded:Wait();
	player.CharacterAppearanceLoaded:Wait();
	char.Archivable = true;
	local cl = char:Clone();
	cl.Parent = workspace;
	char.Archivable = false;
end);

I tried the above code and it did clone my character, but in a different place weirdly.

Well heres how:

c.Archivable = true
local theClone = c:Clone()
theClone.HumanoidRootPart:Destroy()
c.Archivable = false

again, just clones the entire thing and fires my LoadCharacter event for some weird reason.
image

Once again, i want to make cell shading BUT instead of inverse, i want it to be a transparent part/s
EDIT:
Pretty much what i mean:
image
EDIT2:
another example:
image

Mark the Humanoid model as Archivable true, then clone the model. Finally, destroy the root part before dropping it into the workspace

Part of the reason why it might not be a good idea to delete the RootPart is due to how Roblox handles rigs. If you destroy it, Roblox has nothing to apply humanoid state upon and your character falls over.

It may be better to use SelectionBox or the upcoming Highlight class.