Function startTimer help !

Hello everybody! 

function startTimer()    

    timerSource = timer.performWithDelay(1000, showMole, 0)

end

I have this code ^ which activates a “Mole” from appearing and disappearing in different holes. I would like to know if there is a way to make the “Mole” do the same function BUT appear and disappear faster as time progresses. I would really appreciate the replies, thanks!

You could set the time limit to a variable and have that variable controlled by an outside function. Something like this:

local timeVar function showMole() timeVar = timeVar+50 --[[whatever your showMole code is]] end function startTimer() timeVar = 1000 timerSource = timer.performWithDelay(timeVar, showMole, 0) end

Thanks for the reply! Which part of the code would it be to change the time it takes for my object to go faster?

If you’re referring to the part of the code that handles the actual time of the timer, I set that to be the “timeVar” portion.

You could set the time limit to a variable and have that variable controlled by an outside function. Something like this:

local timeVar function showMole() timeVar = timeVar+50 --[[whatever your showMole code is]] end function startTimer() timeVar = 1000 timerSource = timer.performWithDelay(timeVar, showMole, 0) end

Thanks for the reply! Which part of the code would it be to change the time it takes for my object to go faster?

If you’re referring to the part of the code that handles the actual time of the timer, I set that to be the “timeVar” portion.