Provides functionality similar to Luau's (variant of Lua used by Roblox) events system - including the function disconnection return!
Basically gives developers a (hopefully) easy way of setting up and running events - as well as making it easy to set up a function for registering functions to call when the event occurs!
events_api.create(name)
provides a table of information: funcs
(list of functions to be ran), register
(for adding functions to the funcs
list), and handler
(function for running the event, and calling all of the functions inside the funcs
). Provides name
as a field also - which will be the string that it was registered with
It can have an additional definition
argument as so:
events_api.create(name, def)
Which helps set up slightly more in-depth setup with your mod. Be sure to read the API doc for more info!
Utilized by my currently WIP tph_wielditem
mod: https://codeberg.org/TPH/tph_wielditem