Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Attempt To index nil with clone! Please help? I need to fix this error. [closed]

Asked by 5 years ago

Please do not repost your question after it has been closed.

This is my code right here. I have no idea if it's an easy fix or not.

01function commands.invisible(sender, args)
02    local playerinvis = args[1]
03    if playerinvis == "me" then
04        local character = sender.Character
05        local characterClone = character:Clone()
06        characterClone.Name = tostring(sender.Name).."'s Character"
07        characterClone.Parent = ServerS
08        local children = character:GetChildren()
09        for _, child in pairs(children) do
10            if child:IsA("MeshPart") or child:IsA("Part") then
11                child.Transparency = 1
12                elseif child:IsA("Accessory") then
13                    child:Destroy()
14            end
15        end
16    end
17end
0
Oh by the way, the error is on line 6 messi55313 -2 — 5y

Marked as Duplicate by youtubemasterWOW

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?