event

Events handler is a powerful way of calling function from other LUA resources, add a listener to an existant internal events, useful for handling game loop/game logic or trigger an event on server.

Internal client events list:

core:on_gameplay_enter

Called right after you enter the game.

Example:

event.add_handler("core:on_gameplay_enter", function()

    print("You just spawned into the game !")
end)
core:on_gameplay_render

Called every frame (Mostly used to handle UI)

Example:

event.add_handler("core:on_gameplay_render", function()

    print("Called every frame !")
end)
core:on_gameplay_simulate

Called every frame (Mostly used to handle physics, entities spawning, ...)

Example:

event.add_handler("core:on_gameplay_simulate", function()

    -- WARNING: You cannot draw ui functions here !
    print("Called every frame !")
end)

Last updated