Code is:
rednet.open("right")
repeat
local event,p1,p2,p3 = os.pullEvent()
if event=="rednet_message" then
rednet.send(p1, "Turtle ready")
if p2 == "right" then
turtle.turnRight()
elseif p2 == "left" then
turtle.turnLeft()
elseif p2 == "back" then
turtle.back()
elseif p2 == "forward" then
turtle.forward()
elseif p2 == "up" then
turtle.up()
elseif p2 == "down" then
turtle.down()
elseif p2 == "checkforobstacles" then
turtle.detect()
Instead if running this program returns me an error"Attempt to index ? A nil value"
And I have no idea how to fix it. Thanks in advance.