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

Attempt To Call Nil.

Started by NegativeZero6484, 07 June 2014 - 10:16 AM
NegativeZero6484 #1
Posted 07 June 2014 - 12:16 PM
So I made a program to create a simple text, and it called nil. Can I have some help?

if true then
local monitor = peripheral.wrap ("back")
monitor.setTextscale(5)
monitor.setCursorPos(1,1)
monitor.write ("Boo")
end

Thanks for the help.
CometWolf #2
Posted 07 June 2014 - 09:01 PM
I forgot the term for it, but first word lower letters and then first letter capitalized for every word afterwards is considered conventional variable naming in Lua. The issue here is you did not do this with monitor.setTextScale(), as im sure the error number pointed to that lines aswell(3). Please include the full error next time, and use code tags.
Edited on 07 June 2014 - 07:01 PM
MKlegoman357 #3
Posted 07 June 2014 - 09:08 PM
I forgot the term for it…

Camelcase.

Code tags look like this:

[code]
print("Lua code")


Translates to this:


print("Lua code")
Edited on 07 June 2014 - 07:08 PM
Link149 #4
Posted 08 June 2014 - 01:26 AM
So I made a program to create a simple text, and it called nil. Can I have some help?

"attempt to call nil" usually means you tried to call an inexistant function.
Check whether you made any mistake in the function's name, if you didn't then it's
probably because the function was not defined at the line where this error occured.

As CometWolf said, It's probably because you did not capitalize the 'S' in "setTextScale".