←  Ask a Pro

ComputerCraft | Programmable Computers for Minecraft

»

Attempt to call a nil

coolmark1995's Photo coolmark1995 26 Apr 2020

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
Quote

Luca_S's Photo Luca_S 26 Apr 2020

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.
Quote