I am trying to change my timer’s name so it would be easy to cancel it but I am having issues .
local timeLimit = 20 timeLeft = display.newText(timeLimit, 160, 20, native.systemFontBold, 24) timeLeft:setTextColor(255,0,0) function timerDown() timeLimit = timeLimit-1 timeLeft.text = timeLimit if(timeLimit==0)then timerrr.cancel(timerrr) storyboard.gotoScene("maxtime", "fade", 400) end end timer timer=timerrr.performWithDelay(1000,timerDown,timeLimit)
This is the error I am getting
C:\Users\Brandon\Documents\Corona Projects\StopTheBall\game.lua:41: ‘=’
expected near ‘timer’
stack traceback:
[C]: in function ‘error’
C:\Users\Brandon\Documents\Corona Projects\StopTheBall\storyboard.lua:16
41: in function ‘gotoScene’
C:\Users\Brandon\Documents\Corona Projects\StopTheBall\start.lua:21: in
function <C:\Users\Brandon\Documents\Corona Projects\StopTheBall\start.lua:19>
?: in function <?:221>