Skip to content

getEventHandlers

Shared

This function gets the attached functions from the event and attached element from current lua script.

Important

This function only checks the current script.

Syntax

table getEventHandlers ( ​string eventName, ​element attachedTo )
Required arguments
  • eventName: The name of the event.
  • attachedTo: The element attached to.

Returns

Returns table with attached functions, otherwise empty table.

  • table: result

Code Examples

client

This example removes all onClientMarkerHit event.

local events = getEventHandlers("onClientMarkerHit", resourceRoot)
for i, v in ipairs(events) do
removeEventHandler("onClientMarkerHit", resourceRoot, v)
end