-
-
Notifications
You must be signed in to change notification settings - Fork 0
Feature: Timer
Tron edited this page Jan 13, 2023
·
3 revisions
Timer are useful when you've to repeat specific handler at some specified interval for n
times. FiveM's built in Timers are trash and too restrictive when it comes to our way of usage.
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()