function getTree() if turtle.detect() then turtle.dig() turtle.digUp() turtle.up() end while turtle.detectDown() == false do turtle.down() end end function downStair(arg1) function dig() turtle.dig() turtle.up() turtle.dig() turtle.forward() turtle.turnLeft() turtle.dig() turtle.down() turtle.dig() turtle.turnRight() end dig() a = 1 repeat turtle.dig() turtle.forward() turtle.dig() turtle.forward() turtle.turnLeft() turtle.dig() turtle.forward() turtle.turnLeft() turtle.dig() turtle.forward() turtle.digDown() turtle.down() turtle.dig() turtle.forward() turtle.turnLeft() turtle.dig() turtle.forward() turtle.turnLeft() turtle.forward() turtle.dig() turtle.forward() a = a + 1 until a == arg1(This is only the function I need help with the rest of my api is peachy)
(also the values in this function are not used in any other functions)
Anyways it is supposed to make a 2x2 staircase according to how deep you want it (arg1),
but it returns -Attempt to index ? (a nil value)-,
and all my values are either 0 or another value,\
I checked none of them are nil.
Help?
EDIT:When I call the function I go into lua and type 'xAPI.downStair(64)'
EDIT:The error is on line 1 O.o












