While working on a script to clone the player's character I've come across the problem that its not cloning. What am I doing wrong here?
script.Parent.Touched:Connect(function(part) local Players = game:GetService("Players") local player = Players:GetPlayerFromCharacter(part.Parent) wait(1) part.Reflectance = 0.2 wait(3) part.Reflectance = 0.4 wait(3) part.Reflectance = 0.6 wait(3) part.Reflectance = 0.8 wait(5) part.Reflectance = 1 local function crystalize() if player.Character then local c = player.Character:Clone() c.Parent = workspace c.Name = "SCP-409-1("..player.Name..")" local d = c:GetChildren() for i = 1, #d do if d[i].className == "Accessory" then d[i].Mesh.TextureId = "http://www.roblox.com/asset/?id=686337933" d[i].Handle.Transparency = 0 d[i].Anchored = true end if d[i].className == "Part" then if d[i].Name ~= "HumanoidRootPart" then d[i].Anchored = true d[i].Transparency = 0 if d[i].Name == "Head" then if d[i]:FindFirstChild("face") then d[i].face:Destroy() end end end end end end player.Torso:Destroy() end crystalize(part) end)
EDIT: Put the full script opposed to the cut out.
Output:
Workspace.SCPs.SCP-409.Freeze:19: attempt to index local 'c' (a nil value)
Try enabling "Archivable " right before you clone it.
(Line 17-ish):
local character = player.Character character.Archivable = true local c = character:Clone() character.Archivable = false