Timer - lnx00/Lmaobox-Library GitHub Wiki

lnxLib.Utils.Timer

Allows to run code at a given interval. Use this if you want to "wait" in your code or do something every x seconds.

Functions

  • .new() Creates a new Timer instance.

Methods

  • :Run(interval) Returns if the given time has passed since the last call.

Example

...
local myTimer = Timer.new()

local function OnCreateMove()
  if myTimer:Run(1) then
    print("1 second has passed!")
  end
end
...