Files
Basalt/docs/docs1_6/objects/Timer/onCall.md
Robert Jelic d4c72514ef Docs 1.6
Accidentally uploaded outdated 1.6 docs
2023-05-01 16:28:46 +02:00

681 B

onCall

onCall(self)
A custom event which gets triggered as soon as the current timer has finished

Here is a example on how to add a onCall event to your timer:

local basalt = require("basalt")

local mainFrame = basalt.createFrame()
local aTimer = mainFrame:addTimer()

function call()
  basalt.debug("The timer has finished!")
end
aTimer:onCall(call)
    :setTime(2)
    :start()

Here is also a example how this is done with xml:

local basalt = require("basalt")

local mainFrame = basalt.createFrame()

basalt.setVariable("call", function()
  basalt.debug("The timer has finished!")
end)
<timer onCall="call" time="2" start="true"/>