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 4 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.

function commands.invisible(sender, args)
    local playerinvis = args[1]
    if playerinvis == "me" then
        local character = sender.Character
        local characterClone = character:Clone()
        characterClone.Name = tostring(sender.Name).."'s Character"
        characterClone.Parent = ServerS
        local children = character:GetChildren()
        for _, child in pairs(children) do
            if child:IsA("MeshPart") or child:IsA("Part") then
                child.Transparency = 1
                elseif child:IsA("Accessory") then
                    child:Destroy()
            end
        end
    end
end
0
Oh by the way, the error is on line 6 messi55313 -2 — 4y

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?