Lua API
  • 🔎Overview
  • Getting started
    • 🚀Creating scripts
    • 📓Metadata
    • ☎ïļCallbacks
    • 🧠Examples
    • 🌐Useful resources
  • Documentation
    • ⚙ïļNamespaces
      • ðŸ–ĨïļGui
      • ✏ïļRender
      • 🏎ïļEngine
      • ðŸ”ĒMath
      • ⚙ïļUtilities
      • 🙎Entities
      • 📖Database
      • ðŸ–ąïļInput
      • 🌌Panorama
      • ðŸŠķMaterials
      • 📂Filesystem
      • 🗃ïļZip
    • ⚙ïļInstances
      • ⚙ïļGlobal Vars
      • ⚙ïļFatality
      • ⚙ïļGamerules
      • ⚙ïļServer
    • ⚙ïļDatatypes
      • ðŸ–Ĩïļcontrol
      • ðŸ–Ĩïļcheckbox
      • ðŸ–Ĩïļcombobox
      • ðŸ–Ĩïļcolor_picker
      • ðŸ–Ĩïļslider
      • ðŸ–Ĩïļtextbox
      • ðŸ–Ĩïļlist
      • ⚙ïļentity
      • ⚙ïļplayer_info
      • ⚙ïļweapon_info
      • ⚙ïļuser_cmd
      • ⚙ïļtrace_t
      • ⚙ïļvec3
      • ⚙ïļtimer
      • ⚙ïļcvar
      • ⚙ïļshot_info
      • ⚙ïļgame_event
      • ⚙ïļmaterial
      • ⚙ïļmaterial_var
      • ⚙ïļzip
      • ⚙ïļanimator
Powered by GitBook

ÂĐ 2025 - FATALITY

On this page
  • Functions
  • start
  • stop
  • run_once
  • is_active
  • set_delay
  1. Documentation
  2. Datatypes

timer

utils.new_timer

Functions

start

local timer = utils.new_timer(100, function()
    print("This will be printed every 100ms")
end)

timer:start()

Usage:

Begins the timer.

stop

timer:stop()

Usage:

Pauses the timer.

run_once

local timer = utils.new_timer(100, function()
    print("This will be printed once")
end)

timer:run_once()

Usage:

Run a timer once.

is_active

local timer_active = timer:is_active()

Returns:

timer's state

boolean

set_delay

local timer = utils.new_timer(0, function()
    print("This will be run every 1000ms")
end)
timer:set_delay(1000)
timer:start()

delay

number

the amount of ms to change the timer's delay to

Previousvec3Nextcvar

Last updated 2 years ago

⚙ïļ
⚙ïļ
Value
Datatype
Parameter
Datatype
Description