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

attempt to index nil with 'Parent' when cloning the players character?

Hi so i'm trying to clone the character and then when i set the parent of the character it just pastes out a error I'm also trying to make a local because i want to make a menu with the player

Here's the script:

local character = game.Players.LocalPlayer.Character:Clone()
character.Parent = workspace

1 answer

✓ Accepted answer

This is due to the Archivable property. If this property is set to false, this will prevent objects from being cloned.

Using the Clone() method on an object that is not archivable will return nil, hence the error you're receiving.

As the Character's Archivable property is automatically set to false, you'll need to set it to true before using the Clone() method.

local character = game.Players.LocalPlayer.Character
character.Archivable = true

local characterClone = character:Clone()
characterClone.Parent = workspace

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