A port of @azendal's CustomEventSupport to Lua