Anyway to pause a timer instead of stopping it completely?

title


It's not a built-in function, but here's a couple of functions that I think should do the job:

<function name="PauseTimer" parameters="timer"><![CDATA[
  if (timer.enabled and timer.trigger > game.timeelapsed) {
    timer.paused = game.timeelapsed
    timer.enabled = false
  }
]]></function>

<function name="UnpauseTimer" parameters="timer">
  if (HasInt (timer, "paused")) {
    timer.trigger = timer.trigger + game.timeelapsed - timer.paused
    timer.paused = null
    timer.enabled = true
  }
</function>

Log in to post a reply.

Support

Forums