Lua API
  • 🔎Overview
  • Getting started
    • 🚀Creating scripts
    • 📓Metadata
    • ☎ïļCallbacks
    • 🧠Examples
    • 🌐Useful resources
  • Documentation
    • ⚙ïļNamespaces
      • ðŸ–ĨïļGui
      • ✏ïļRender
      • 🏎ïļEngine
      • ðŸ”ĒMath
      • ⚙ïļUtilities
      • 🙎Entities
      • 📖Database
      • ðŸ–ąïļInput
      • 🌌Panorama
      • ðŸŠķMaterials
      • 📂Filesystem
      • 🗃ïļZip
    • ⚙ïļInstances
      • ⚙ïļGlobal Vars
      • ⚙ïļFatality
      • ⚙ïļGamerules
      • ⚙ïļServer
    • ⚙ïļDatatypes
      • ðŸ–Ĩïļcontrol
      • ðŸ–Ĩïļcheckbox
      • ðŸ–Ĩïļcombobox
      • ðŸ–Ĩïļcolor_picker
      • ðŸ–Ĩïļslider
      • ðŸ–Ĩïļtextbox
      • ðŸ–Ĩïļlist
      • ⚙ïļentity
      • ⚙ïļplayer_info
      • ⚙ïļweapon_info
      • ⚙ïļuser_cmd
      • ⚙ïļtrace_t
      • ⚙ïļvec3
      • ⚙ïļtimer
      • ⚙ïļcvar
      • ⚙ïļshot_info
      • ⚙ïļgame_event
      • ⚙ïļmaterial
      • ⚙ïļmaterial_var
      • ⚙ïļzip
      • ⚙ïļanimator
Powered by GitBook

ÂĐ 2025 - FATALITY

On this page
  • How to use
  • Callbacks
  • on_paint
  • on_paint_traverse
  • on_frame_stage_notify
  • on_setup_move
  • on_run_command
  • on_create_move
  • on_input
  • on_console_input
  • on_shutdown
  • on_shot_registered
  • on_level_init
  • on_game_event
  • on_xxx
  • on_do_post_screen_space_events
  • on_config_load
  • on_config_save
  • on_esp_flag
  • on_draw_model_execute
  • Player callbacks
  • on_player_connect
  • on_player_disconnect
  • on_player_spawn
  • on_player_hurt
  • on_player_death
  1. Getting started

Callbacks

Although this api does not use true callbacks, they will be referred to as such.

How to use

To create a callback you need to use one of the many names listed below to access them.

-- Callbacks CANNOT be local
-- "local function on_shot_fired" will not work

function on_shot_fired(shot_info)
    print(string.format("Expected damage: %i", shot_info.client_damage)
end

function on_paint()
    render.rect_filled(10, 10, 110, 110, render.color("#FFFFFF"))
end

Callbacks

on_paint

Called every frame.

function on_paint()
    render.rect_filled(10, 10, 110, 110, render.color("#FFFFFF"))
end

on_paint_traverse

Called every frame.

Use this to call surface functions with ffi.

function on_paint_traverse()

end

on_frame_stage_notify

stage

stage called on

pre_original

boolean

whether or not frame_stage_notify has been called yet

function on_frame_stage_notify(stage, pre_original)
    if stage == csgo.frame_render_start then
        print("Rendering has started!")
    end
end
Stages
  • csgo.frame_render_end

  • csgo.frame_net_update_end

  • csgo.frame_net_update_postdataupdate_end

  • csgo.frame_net_update_postdataupdate_start

  • csgo.frame_net_update_start

  • csgo.frame_render_start

  • csgo.frame_start

  • csgo.frame_undefined

on_setup_move

Called every game tick before the command is used internally.

Use to call movement-related things.

cmd

user command

function on_setup_move(cmd)
    cmd:set_move(xxx)
end

on_run_command

Called for every tick in a choked cycle the moment it is going to be sent to the server, after the cheat's anti-aim has run.

Use to change angles without cheat interference. All angle changes will be movement corrected.

cmd

user command

function on_run_command(cmd)
    cmd:set_view_angles(xxx)
end

on_create_move

Called every game tick after everything internally has finished.

Use to run something on a per-tick basis that does not modify commands.

cmd

user command

send_packet

boolean

true if a packet will be sent

function on_create_move(cmd, send_packet)
    do_anti_aim()
end

on_input

msg

number

wParam

number

used to pass values with specific messages

lParam

number

used to pass values with specific messages

function on_input(msg, wParam, lParam)

end

on_console_input

input

string

console input

function on_console_input(input)
    
end

on_shutdown

Called when the script is unloaded.

function on_shutdown()
    
end

on_shot_registered

Called after a shot has been fired.

Use to get information about shots.

shot_info

the shots information

function on_shot_registered(shot_info)
    print(string.format("Expected damage: %i", shot_info.client_damage))
end

on_level_init

Called after the map has loaded.

function on_level_init()
    
end

on_game_event

Called on any game event.

event

game event

function on_game_event(event)

end

on_xxx

Called on a specific game event.

event

game event

function on_item_pickup(event)

end

on_do_post_screen_space_events

Called after post processing has finished.

function on_do_post_screen_space_events()

end

on_config_load

Called after a config is loaded.

function on_config_load()

end

on_config_save

Called after a config has been saved.

function on_config_save()

end

on_esp_flag

index

integer

index of player drawing

Return a table of flags that you want to add

function on_esp_flag(index)
    return
    {
        render.esp_flag("first extra flag", render.color("#FFFFFF")),
        render.esp_flag("second extra flag", render.color("#FFFFFF")),
    }
end

on_draw_model_execute

dme

function

calls dme (draws the model)

ent_index

integer

entity's index

model_name

string

model's name

function on_draw_model_execute(dme, ent_index, model_name)
   -- How to do overlay cham
   dme() -- call dme to draw the model with the normal material
   mat.override_material(overlay_mat) -- set the overlay material
   -- you do not need to call dme again. it is called after the callback
end

Player callbacks

on_player_connect

Called after a player has connected.

event

game event

function on_player_connect(event)
    print("player connected")
end

on_player_disconnect

Called after a player has disconnected.

event

game event

function on_player_disconnect(event)

end

on_player_spawn

Called after a player has spawned.

event

game event

function on_player_spawn(event)

end

on_player_hurt

Called after a player has been hurt.

event

game event

function on_player_hurt(event)

end

on_player_death

Called after a player has died.

event

game event

function on_player_death(event)

end
PreviousMetadataNextExamples

Last updated 2 years ago

Use to draw with the namespace.

Called when on a specific .

Called on .

Read the and prefix one with "on_" to set a callback to it.

☎ïļ
render
frame
wndproc
list of events
Parameter
Datatype
Description
Parameter
Datatype
Description
user_cmd
Parameter
Datatype
Description
user_cmd
Parameter
Datatype
Description
user_cmd
Parameter
Datatype
Description
window message
Parameter
Datatype
Description
Parameter
Datatype
Description
shot_info
Parameter
Datatype
Description
game_event
Parameter
Datatype
Description
game_event
Parameter
Datatype
Description
Parameter
Datatype
Description
Parameter
Datatype
Description
game_event
Parameter
Datatype
Description
game_event
Parameter
Datatype
Description
game_event
Parameter
Datatype
Description
game_event
Parameter
Datatype
Description
game_event
csgo.frame_stage