I’m trying to clone the players avatar, but it doesn’t clone the avatar and it won’t let me change anything about it. I tried printing the name of “Character”, but it also gives back an error saying Name is nil.
local CharacterModel = game.Players.LocalPlayer.Character
print(CharacterModel.Name)
local Character = CharacterModel:Clone()
Character.Parent = workspace
Character.Name = "Clone"
Error:
Players.blushclips.PlayerGui.Ragdoll:17: attempt to index nil with 'Parent'
Yes it’s in a localscript. I’ve never tried to clone a avatar before, so I’m not sure if you’re can clone the avatar directly or if you have to reconstruct the avatar.
Try setting the “Archivable” property of the character to true. By default it’s set to false, which makes it un-clonable. Also, add in some kind of wait, as the character model is usually not loaded when the script runs.
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
character.Archivable = true
local characterModel = character:Clone()
character.Archivable = false
characterModel.Name = character.Name.. " Clone"
characterModel.Parent = workspace
EDIT: Some clarification, the character model’s Archivable property is set to false by default. This is not the case for other Instance’s though, as they have an Archivable property set to true by default.
A server script is completely unnecessary in this case, and in your code you haven’t even set the Archivable property to true, which needs to be as by default a character model has a Archivable property of false by default.
Hey, sorry to ask you but do you know any tips you could give me on changing the players camera subject from the clone to the original avatar because when the clone is made the camera goes to the clone instead of staying with the original avatar.