4 posts
Posted 16 November 2014 - 06:21 PM
Hello! I am new to lua, and am getting quite a few issues when trying to debug it. Mainly im having issues with an <eof> error on line 34. All advice welcome! Thanks!
Code:
http://pastebin.com/ETDFYG2B
7083 posts
Location
Tasmania (AU)
Posted 16 November 2014 - 10:47 PM
You've got too many end statements. Consider
indenting that section properly - that should make the problem clearer too you.
Basically, since you've "end"ed a block you never started, the Lua interpreter is assuming that means you want to end the entire script. But since you've still got code after that point, it guesses you made a mistake - it's expecting the End Of File, and errors out accordingly.
283 posts
Posted 16 November 2014 - 11:00 PM
<eof,> means u need to delete an end
4 posts
Posted 16 November 2014 - 11:40 PM
You've got too many end statements. Consider
indenting that section properly - that should make the problem clearer too you.
Basically, since you've "end"ed a block you never started, the Lua interpreter is assuming that means you want to end the entire script. But since you've still got code after that point, it guesses you made a mistake - it's expecting the End Of File, and errors out accordingly.
I don't see the extraneous end
7083 posts
Location
Tasmania (AU)
Posted 17 November 2014 - 12:19 AM
It's sitting right on line 34, the point at which the script errored out. Get rid of it.
While you're at it, you're also missing an end from under line 45.
Edited on 16 November 2014 - 11:19 PM
4 posts
Posted 17 November 2014 - 11:02 PM
Hello, I am new to lua, and am having an issue with this program:
http://pastebin.com/eS7rxEiQ , I keep getting an "Attempting to index a nil value" error on line 36. Any help, relevant or not, welcome!
7083 posts
Location
Tasmania (AU)
Posted 17 November 2014 - 11:37 PM
As I told you before, indent it properly and you'll see the problem. You've moved your ends around, but you still haven't got them all in the correct places.
1220 posts
Location
Earth orbit
Posted 18 November 2014 - 12:12 AM
After reviewing my post, I realized my comments would probably just confuse the matter at this stage so, instead, I will re-iterate what Bomb Bloke said: Your code really needs proper indentation. Troubleshooting your code right now is unnecessarily difficult (and obvious errors like your 'end' problem aren't very obvious).
Also, for future reference - it's spelled 'Lua', not 'lua' or 'LUA' - it's not an acronym, it's a word and it means 'moon'. :)/>
Edited on 17 November 2014 - 11:27 PM
7508 posts
Location
Australia
Posted 18 November 2014 - 12:26 AM
merged threads. please keep help with the same code within the same thread, it helps us keep better track of the problems you're encountering and give you better more relevant assistance as we can see a history as well.