Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

component.setTimer{ } is used to set a component or function poll time

By default, it sets time (delay in milliseconds) for the main function, unless the callback parameter is specified with another function.

Code Block
languagelua
local TimerId = component.setTimer{delay=1000, callback=OnTimer, data="Some Data"}

function OnTimer(Data)
   trace("-- This function will be called when the timer is triggered")
end