Change delay in timer

Hi, sorry for the second question in 3 days.

I want change my delay timer but I don’t know how. My “spawnTimer” starts at 800, when the score reach 10 I want change the delay to 500. I tried to change the first parameter of the timer with a variable but the timer is called once so it is always 800. How can I do this?

This is my code:

local spawnTimer local updateTimer local seconds = 800 local update = function() if (score \> 10) then seconds = 500 end end spawnTimer = timer.performWithDelay(seconds, spawn, 0) updateTimer = timer.performWithDelay(1, update, 0)

Sorry but I didn’t search enough in this forum!

Thanks to @Satheesh I wrote this:

local spawnTimer local updateTimer local update = function() if (score \> 10) then speed = 3000 seconds = 200 spawnTimer.\_delay = seconds -- This is the solution! end end spawnTimer = timer.performWithDelay(seconds, spawn, 0) updateTimer = timer.performWithDelay(50, update, 0)

Sorry but I didn’t search enough in this forum!

Thanks to @Satheesh I wrote this:

local spawnTimer local updateTimer local update = function() if (score \> 10) then speed = 3000 seconds = 200 spawnTimer.\_delay = seconds -- This is the solution! end end spawnTimer = timer.performWithDelay(seconds, spawn, 0) updateTimer = timer.performWithDelay(50, update, 0)