I'm trying to learn Lua and I think I have a basic understanding so far. My Problem is that I can't figure out why my program is giving this error. I've traced back the function and it all seems right. I've modified a tunnel program to make paths. I used some of the code made by HuskyBlueFire. Any help would be great. When I run the program it gives me this error:
DiggyPath:652: attempt to call nil
Here is the pastebin link to my code.
http://pastebin.com/dMXRtGtm
Function Not working?
Started by raysilverstone, Nov 30 2013 09:23 PM
1 reply to this topic
#1
Posted 30 November 2013 - 09:23 PM
#2
Posted 30 November 2013 - 10:36 PM
Notice how the "moveForward()" and "moveBack()" functions are both missing an "end", but "removeXChest()" and "removeIChest()" have an extra one each?
This means that the bulk of your function declarations are inside the "moveForward()" function. As far as Lua is concerned, those encapsulated functions don't exist until that function has been called (which causes it to process those extra declarations).
Anyhow, move those "end"s and give it another shot.
This means that the bulk of your function declarations are inside the "moveForward()" function. As far as Lua is concerned, those encapsulated functions don't exist until that function has been called (which causes it to process those extra declarations).
Anyhow, move those "end"s and give it another shot.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











