Jump to content




:37: attempt to call nil


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

#1 darkroom

  • Members
  • 70 posts

Posted 12 December 2012 - 10:56 AM

This problem has been vexing me for three days now this is my first post because i have tried almost everything i can think of to make this work. This program is a simple menu program and everything about it works BESIDES a this function local event , key = os.pullEvent(key). I checked the wiki and all the syntax is right. I rewrote the program 3 times to try to get it to work..... no luck when i try just the command without the program it works.... anyway thanks for your time here is the code for you to see.

http://pastebin.com/7aZgr8RR

#2 OmegaVest

  • Members
  • 436 posts

Posted 12 December 2012 - 10:57 AM

os.pullEvent("key")

Needs quotes. Otherwise it thinks you are trying to call the empty variable you just instantiated.

#3 darkroom

  • Members
  • 70 posts

Posted 12 December 2012 - 10:58 AM

tried that doesn't work and wow that was fast

#4 OmegaVest

  • Members
  • 436 posts

Posted 12 December 2012 - 11:02 AM

Oh, I see.


You wrote over an API with a table. Don't label things os. Use os1. That's why it doesn't know about pullEvent().

#5 darkroom

  • Members
  • 70 posts

Posted 12 December 2012 - 11:03 AM

oh... my... god.... i thought i was a better coder than that :P thanks a bunch

#6 OmegaVest

  • Members
  • 436 posts

Posted 12 December 2012 - 11:09 AM

We all have our days. I spent a good few hours looking for a lost if-end. Turns out I had left off an equals somewhere.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users