Attempt to index nil with Parent?

Hello,

I am trying to clone the player’s character to my viewport frame… This script should be pretty simple, but ROBLOX wants to act stupid…
Here’s the portion of the script:

local plr = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local char = plr.Character or plr.CharacterAdded:Wait()
local clonedChar = char:Clone()
local vp = script.Parent
local newCam = Instance.new("Camera",vp)
vp.CurrentCamera = newCam
newCam.CameraType = "Scriptable"
clonedChar.Parent = vp

Thanks in advance

You have to Enable Archivable within the Players Character Model, otherwise you cant clone it at all.

The descendants of the character arent cloning… I set them to archivable…

local char = plr.Character or plr.CharacterAdded:Wait()
char.Archivable = true
for _,limb in next,char:GetChildren() do
	limb.Archivable = true
end

The Descendants are already set to true so doing this wont do anything.

I removed the part… but it still wont clone the descendants??

You enable it for the player character, not the parts.

local char = plr.Character or plr.CharacterAdded:Wait()
char.Archivable = true
local clonedChar = char:Clone()
clonedChar.Parent = workspace.PlayerClonesSomewhere

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.