Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I copy the character?

I have had trouble copying a character.

Here's my code:

local player = game.Players.LocalPlayer
local char = player.Character

char.Archivable = true

local copy = char:Clone()
copy.Parent = char.Parent

for _,part in pairs(char:GetChildren()) do
	part:Clone()
	part.Parent = copy
end

Whenever I start the game, it copies the model, but doesn't copy the descendants or children. I tried it without the for loop too, but it still copies the model only, and it's just a blank model.

5 comments

0

Try grabbing the model instead and copying it.

0

Sorry what do you mean my grabbing it?

0

by*

0

just do char:Clone()

0

I did, but it copies the model and nothing inside of it.

1 answer

✓ Accepted answer

There is a function named :GetDescendants() which will fetch every descendant in a Instance

You didnt assign a variable to the copied part, so you cannot parent them to another object

local A = v:Clone()
A.Parent = char

Or you can do this, which looks ugly,

v:Clone().Parent = char

3 comments

0

I tried that too, but it still only clones the model and nothing inside it.

0

updated my answer

0

Thank you so much I didn't see that lol

This discussion is preserved as it was. New answers, comments, and votes are closed.