Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Latest commit

 

History

History
46 lines (27 loc) · 708 Bytes

module-events.md

File metadata and controls

46 lines (27 loc) · 708 Bytes

Module Events

Each module has several events where you can execute code.

onEnable

This is called whenever the module is enabled.

onDisable

This is called whenever the module is disabled.

onUpdate

This is called whenever the player is updated.

onRender2D

This is called when the in-game overlay is rendered.

onPacket

This is called when a packet is sent or received.

We can utilise these events in the following way:

onUpdate = function()
    -- Your code here
end

A full implementation of this would look like:

manager:registerModule('test', 'sex', newModule ({
        onUpdate = function()

        end
    })
)

This is done the same way for all events.