#Am I calling the function wrong or smth?

1 messages · Page 1 of 1 (latest)

sly dust
#
function node:get(object)
    print(object) --prints nil
    if object:isA("Configuration") then
        if object:GetAttribute("NodeTree") then 
            error(`{object} is a NodeTree`)
        end

        return object
    end

    if not object.Parent then 
        error(`{object} has no parent`)
    end

    return self:get(object.Parent)
end

function node:next(object, path)
    print(object) --prints the obj in workspace
    object = self:get(object)
    path = path or "MainPathway"

    checkOutputs(getNodePath(object, path))

    local locked, activeLock = checkLocks(object[path].Outputs:GetChildren())

    if not locked then
        return getNoLock(object, path)
    end

    checkLock(activeLock)

    return self:get(activeLock.MainPathway.Outputs:GetChildren()[1].Value)
end

Wehn I print object after calling node:next() it prints the object

Wehn I call the function node:get() with that variable and print that variable again it smh prints nil can someone explain this?