This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
BpEoEnRg's profile picture

theme:17:attempt to call nil

Started by BpEoEnRg, 12 August 2014 - 12:57 AM
BpEoEnRg #1
Posted 12 August 2014 - 02:57 AM
I'm a moderator on a tekkit classic server, running cc ver 1.3, and do most of the cc stuff for people. I have two people wanting ticket systems for there "parks" and really like you're program here. My problem is that the function isValid() keeps returning nil with error theme:17:attempt to call nil, theme being the program name. I can remove the check for is valid and the rest of the program functions fine but then of course any disk works. I've tried every variation for the local diskID individually and none are working.
CCJJSax #2
Posted 12 August 2014 - 04:08 AM
post your code
theoriginalbit #3
Posted 12 August 2014 - 04:54 AM
That error means that you're attempting to call a function that doesn't exist. As the error message also shows you're attempting to do this on line 17 of the theme program. The most likely cause of this is due to a typo or spelling mistake in the call, also do note that Lua is case-sensitive so make sure you have the capitalisation correct. Any more advice will have to come as you post your code, we can't do much more than speculate without seeing code.
MKlegoman357 #4
Posted 12 August 2014 - 09:50 AM
Also note that you have to first define the function before you can use it:

Correct usage:

local function foo ()
  print("bar")
end

foo() -->> bar

Incorrect usage:

foo() -->> error: attempt to call nil

local function foo ()
  print("bar")
end
Edited on 12 August 2014 - 07:52 AM