Repository navigation
Library: Timer
Aviril edited this page Nov 29, 2024
·
9 revisions
Timer are useful when you've to repeat specific handler at some specified interval for n times. MTA's built in Timers are trash for direct usage especially if you've to pass arguments such as tables since by default Arguments aren't passed by reference.
Add the below code once in either of the shared .lua script of the resource you want to use within:
--Declare it globally only once
loadstring(exports.assetify_library:import("timer"))()local string: type = self:getType()local timer: cTimer = assetify.timer:create(
function: exec,
int: interval,
int: executions,
~: ...arguments
)local bool: result = self:destroy()