Is there a way to save the CountUp timer after finishing the scene as a text to other lua file? But im having an error with SaveTimer.lua on text=currentTime it said bad argument on newText. What will happen is after using timer.lua it will save its counUpText on my SaveTimer.lua
SaveTimer.lua
local time\_label = display.newText({parent=uiGroup, text=currenTime, font=native.systemFontBold, fontSize=128, align="center"}) time\_label.x = 540 time\_label.y = 750 time\_label:setFillColor(0.9,0.9,0)
Timer.lua
currentTime local gameTime = 0 function startTimer() clockTimer = timer.performWithDelay(1000,doCountUp,gameTime) end function doCountUp() currentTime = countUpText.text currentTime = currentTime +1 countUpText.text = currentTime if(currentTime == 0) then countUpText.text = currentTime startTimer() end end countUpText = display.newText(gameTime,259,50,native.systemFontBold,100) countDownText:setTextColor("#000000")