Skip to content

Events

Every event a script can handle, and what its callback receives.

Add a handler with events.<name>:add(fn) and remove it with events.<name>:remove(fn).

events.paint:add(function() end)

Every game tick (64 a second). Draw with render.* here; the frame is kept until the next tick.

events.createmove:add(function(cmd: Cmd) end)

Every user command the game builds, after Nyx's aimbot and before its anti-aim. Read or change it with cmd:*.

events.frame_stage:add(function(stage: number) end)

Every frame stage of every frame. Shares one budget per frame across all stages.

events.game_event:add(function(name: string, e: GameEvent) end)

weapon_fire, bullet_impact, player_hurt, player_death, player_spawn, round_start or round_end. e has attacker, victim, weapon, damage, armor, health, hitgroup, team and position.

events.level_init:add(function(map: string) end)

A map finished loading.

events.level_shutdown:add(function(map: string) end)

The map is being left (disconnect or map change).

events.menu_toggled:add(function(open: boolean) end)

The Nyx menu opened or closed.

events.config_loaded:add(function(name: string) end)

A config was loaded; the script's controls already show its values.

events.unload:add(function() end)

The script is being unloaded. Its overrides are undone after this returns.