-
Notifications
You must be signed in to change notification settings - Fork 3
Timer
lnx00 edited this page Mar 14, 2023
·
2 revisions
Allows to run code at a given interval. Use this if you want to "wait" in your code or do something every x seconds.
-
.new()Creates a new Timer instance.
-
:Run(interval)Returns if the given time has passed since the last call.
...
local myTimer = Timer.new()
local function OnCreateMove()
if myTimer:Run(1) then
print("1 second has passed!")
end
end
...