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

Im having a problem with the GetConnectedParts part in this script im making any help?

Asked by 6 years ago

heres the script

script.Parent.Touched:Connect(function(part)
    local h = part.Parent:findFirstChild("Humanoid")
    local g = part.Parent.Parent:findFirstChild("Head")
    local c = script.Parent:GetConnectedParts()
    local v = c:findFirstChild(part)

    if h==nil then if g==nil then if v==nil then

    end
    end
    end
    end)

heres the error message

20:34:19.731 - Workspace.Part.Script:6: attempt to call method 'findFirstChild' (a nil value)

thank you for your time

0
there isnt anything on line 6 iddash 45 — 6y
0
And :GetConnectedParts() returns a table , and you cant use :FindFirstChild() on table. You would have to use a for loop iddash 45 — 6y

Answer this question