onInit

On onInit gets triggered once, when CET loads in all the mods. This event ensures that CET has fully loaded, and you have access to the Scripting API. There can be only one onInit event per mod.

Use it to register any Observers, as well as do any one-off actions needed for your mod.

This event is a safe starting point for your code interaction with the game, as it guarantees the access to most of the Scripting API.

This event is also triggered when using "Reload all mods" button in the CET Overlay, as it fires when CET load all mods.

Usage Example

init.lua
registerForEvent('onInit', function()

    print('Game is loaded')
    
end)

Last updated