Jump to content




attempt to call nil


  • You cannot reply to this topic
2 replies to this topic

#1 SeeJay

  • New Members
  • 2 posts

Posted 23 December 2012 - 09:31 AM

Sorry if this is a stupid question, but I am new to programming and even newer to Lua

Here's my code

print("How High?")
h = tonumber(read())
	 turtle.goUp(h)
	 turtle.select(1)
	 if turtle.getItemCount(1) < 1 then
		  turtle.select(2)
	 end
	 turlte.place()
print("Your Platform is complete")

it gives me an attempt to call nil error on the line with
turtle.goUp(h)


any help would be appreciated, I just can't figure out what I am doing wrong, I come from a Java background, so some of this syntax is somewhat frustrating. This is probably really simple, I just want to start learning some Lua, because this mod is really interesting

#2 Doyle3694

  • Members
  • 815 posts

Posted 23 December 2012 - 09:32 AM

first, it's turtle.up().

Second, turtle.up() dont accept any arguments, so running it many times will make you have to use a for loop.

#3 SeeJay

  • New Members
  • 2 posts

Posted 23 December 2012 - 09:34 AM

Oh wow, I'm feel stupid now, thank you so much, I probably should have noticed that... I guess I shouldn't assume things have arguements

Thanks for the quick response!





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users