getEventHandlers
Shared
Lists the functions this resource put on an element's event with addEventHandler.
table getEventHandlers(string eventName, element attachedTo)
Parameters
| Name | Type | Description |
|---|---|---|
| eventName | string | The event's name. |
| attachedTo | element | The element the handlers were put on. Its ancestors' handlers are not included. |
Returns
A table of the functions, in the order they are called. Empty if there are none.
Other resources' handlers on the same element do not show.
Example
for _, handler in ipairs(getEventHandlers("onPlayerJoin", root)) do
removeEventHandler("onPlayerJoin", root, handler)
end