For some reason when I try to change the clone’s parent it gives me this error
local char
script.Parent.RemoteEvent.OnServerEvent:Connect(function(plr,mode)
char = plr.Character
if mode == "fakeclone" then
local clone = char:Clone()
clone.Parent = workspace
char:PivotTo(char.HumanoidRootPart.CFrame * CFrame.new(0,0,3) )
for i,v in pairs(char:GetDescendants()) do
if v:IsA("BasePart") or v:IsA("MeshPart") then
v.Transparency = 1
elseif v:IsA("Decal") then
v.Transparency = 1
end
end
clone:FindFirstChildOfClass("Humanoid").Died:Once(function()
for i,v in pairs(clone:GetChildren()) do
if v:IsA("BasePart") or v:IsA("MeshPart") then
v.Anchored = true
v.Color = BrickColor.new("Really red")
v.Material = Enum.Material.Neon
end
end
local explosao = Instance.new("Explosion",workspace)
explosao.Position = clone:FindFirstChild("Head")
explosao.BlastRadius = 20
explosao.BlastPressure = 1500
end)
task.wait(10)
clone:Destroy()
for i,v in pairs(char:GetDescendants()) do
if v:IsA("BasePart") or v:IsA("MeshPart") then
v.Transparency = 1
elseif v:IsA("Decal") then
v.Transparency = 1
end
end
end
end)