It may not be as straight forward as just getting the value. You’ve set a repeating timer. It’s going to repeat at that value until it’s canceled or the number of iterations complete.
The way most people would do this is to not set a repeating timer, but simply start a new timer when the function called by the timer (addNewBox in your case) completes. That way you could have a variable holding the speed of the timer and you could use a slider to change the timer’s time value.
local tmrWait = 200 -- default value. local boxTimer = nil local function sliderListener( event ) print( "Slider at " .. event.value .. "%" ) tmrWait = event.value end local function addNewBox() -- do stuff if tmrWait \> 0 then -- give yourself a way to stop the timer from restarting. boxTimer = timer.performWithDelay( tmrWait, addNewBox, 1) end end boxTimer = timer.performWithDelay(tmrWait, addNewBox, 1)
The code is untested, but it should give you an idea.
Rob