null - Lua Script:attempt to call global 'tonubmer' (a nil value) -


i new lua,i don't know why,does related environment or libarary?it drive me crazy, being search answer hours.

function gradient()    local maxstep = 10;    local starcolor="41b0f7";    local endcolor ="1622df";    local sb = tonubmer(string.sub(starcolor,1,2),16);    return sb; end print(gradient()); 

there 2 things going on here:

  1. lua standard library functions tonumber global variables.
  2. if try access global variable not exist (in case, tonu*bm*er) nil ny default.

i recommend using linting tool luainspect detect these typos before bite you.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -