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

Attempt to call a nil

Started by coolmark1995, 26 April 2020 - 02:34 AM
coolmark1995 #1
Posted 26 April 2020 - 04:34 AM
Not sure what I am doing wrong but the program wont even start this code is causing the error below

function updateSize()
  width, height = term.getSize()
  rows = math.floor((width - 1) / 25)
  offset = math.floor((width - rows * 25 + 1) / 2)
  surf = surface.create(width, height)
end
Luca_S #2
Posted 26 April 2020 - 02:03 PM
Can you please post your complete code and the full error you are getting?
Without seeing all the code I'd guess that surface.create is not defined.