Skip to content

Callbacks & Events

Callbacks hook into CS:GOโ€™s tick execution, render loops, and engine events.


-- Hook an event
client.add_callback(event_name, callback_fn)
-- Remove a specific hook
local removed = client.remove_callback(event_name, callback_fn)
  • Invalid event names output an error and do nothing.
  • Multiple callbacks on the same event run in registration order.
  • client.remove_callback returns true if removed, false otherwise.

Event Arguments Timing & Usage
render (none) Frame rendering phase. Only valid callback for render.* drawing methods.
createmove cmd: user_cmd_t Pre-aimbot tick processing. Writes to cmd are applied to the server packet.
post_createmove cmd: user_cmd_t Post-engine tick processing snapshot. Read-only.
antiaim ctx: antiaim_context_t Anti-aim calculation phase before final angles are built.
frame_stage stage: number CS:GO FrameStageNotify hook.
level_init (none) Triggered when a new map finishes loading.
game_events event: game_event_t Engine game events (player_death, player_hurt, bullet_impact, etc.).
aim_shot shot: shot_t Ragebot client-side fire intent.
aim_ack shot: shot_t Server response for a shot (hit/miss/spread/resolver).
pre_anim_update player: player_t Local player, before animation update (globals.curtime matches tickbase).
post_anim_update player: player_t Local player, after animation update.
local_alpha player: player_t, alpha: number Return 0..1 to override local player chams opacity.
draw_chams class: number Model draw interception hook for custom materials.
voice_message data: recv_voice_data_t Incoming voice packet from another player.
console_input command: string Intercepts console commands before execution.
unload (none) Script unload cleanup hook.

Stages passed to frame_stage:

local FRAME_START = 0
local FRAME_NET_UPDATE_START = 1
local FRAME_NET_UPDATE_POSTDATAUPDATE_START = 2
local FRAME_NET_UPDATE_POSTDATAUPDATE_END = 3
local FRAME_NET_UPDATE_END = 4
local FRAME_RENDER_START = 5
local FRAME_RENDER_END = 6
client.add_callback("frame_stage", function(stage)
if stage == FRAME_NET_UPDATE_END then
-- Post-net-update logic
end
end)

The draw_chams callback triggers before each model category renders:

Class ID Model Target
0 Enemy player
1 Shot model (hitmarker / impact chams)
2 Backtrack record model
3 Local player
4 View model (first-person weapon & hands)
5 Attachment (weapons in hand, defusers, grenades)
  • Return 0: Takeover mode. Native rendering is blocked. You must draw the model with materials.draw_chams(mat).
  • Return 1: Passthrough mode. Game renders the model normally.
local flat_mat = materials.create("script/flat_chams", "UnlitGeneric", {
basetexture = "vgui/white",
ignorez = 1,
nofog = 1,
})
client.add_callback("draw_chams", function(class)
-- Only override enemy players (class 0)
if class ~= 0 then
return 1
end
flat_mat:color_modulate(color(255, 40, 90))
materials.draw_chams(flat_mat)
return 0 -- Handled
end)