M MY Multiplayer: Wiki
Side
Kind

getEventHandlers

Shared

Lists the functions this resource put on an element's event with addEventHandler.

table getEventHandlers(string eventName, element attachedTo)

Parameters

NameTypeDescription
eventNamestringThe event's name.
attachedToelementThe 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

See also