LocalEvent

LocalEvent is not creatable, there's only one instance of it. It can only be accessed through its globally exposed variable.

LocalEvent is a shortcut to require("localevent"). See localevent module.

-- example, using LocalEvent:Listen instead of require("localevent"):Listen
local listener = LocalEvent:Listen(LocalEvent.Name.Tick, function(dt)
  -- execute something in loop
end)
listener:Pause() -- pauses the listener
listener:Resume() -- resumes listening
listener:Remove() -- removes listener (listener shouldn't be used after this)