Adding score Automatically over time

Hello, I am making an app at the moment with Corona and I have come to a point where I am stuck.

I want to make it so that when the image is clicked the “tap” event makes the score +1 every second, then after every click it adds the amount added to the score by 1 everytime the image is clicked.

Thanks in advance for any help.

I just typed this up quickly, should be what you’re looking for;
 
 

local addPoints = 0 local function tapToAdd() if addPoints == 0 then --Start the timer to add the points addPoints = addPoints + 1 local tmr = timer.performWithDelay( 1000, function() score = score + addPoints end, -1) elseif addPoints \> 0 then -- If the var 'addPoints' is greater than 0; increase the variable addPoints = addPoints + 1 end end object:addEventListener("tap", tapToAdd)

I just typed this up quickly, should be what you’re looking for;
 
 

local addPoints = 0 local function tapToAdd() if addPoints == 0 then --Start the timer to add the points addPoints = addPoints + 1 local tmr = timer.performWithDelay( 1000, function() score = score + addPoints end, -1) elseif addPoints \> 0 then -- If the var 'addPoints' is greater than 0; increase the variable addPoints = addPoints + 1 end end object:addEventListener("tap", tapToAdd)