Not to be confused with Events.
The event type is used for events such as events.TICK. To create an event function, use one of the following.
 local tick = 0
function events.WORLD_TICK()
  tick = tick + 1
end
-- OR
local tick = 0
events.WORLD_TICK:register(function()
  tick = tick + 1
end, "TICK_COUNTER")
Methods
| Method | Description | 
|---|---|
| remove | Takes in a string with the name of the event, and removes it, stopping it from being called | 
| clear | Clears the event of all methods | 
| register | Takes in a function to run when the event is fired, with an optional name argument (string) | 
| getRegisteredCount | Returns the amount of functions registered, with an optional name argument (string) | 
remove
Removes a function from an event, returning how many were removed
Overloads:
local tick = 0
function tickThing()
  tick = tick + 1
  print("tick " .. tick)
  if tick > 5 then
    events.TICK:remove("thing:)
  end
end
events.TICK:register(tickThing, "tickThing")
clear
Similar to remove, but removes every event
Overloads:
| Arguments | Return | 
|---|---|
| none | nil | 
-- Example function to clear all events
function clearEvents()
  for _, v in pairs(events:getEvents()) do
    v:clear()
  end
end
register
Registers a function to an event
Overloads:
local fps = 0
events.RENDER:register(function()
  fps = client.getFPS()
end)
getRegisteredCount
Gets the number of registered functions in an event, optionally filtering by name
Overloads:
local fps = 0
events.RENDER:register(function()
  fps = client.getFPS()
end)
