Elysium scripting Editor API index
Index

API index

Every function, method and constant in the guide, A to Z.

A

  • ui.accent()Menus & controlsThe accent colour - the same as ui.theme().accent.
  • ent:accuracy_penalty()Players & entities
  • subscription:active()Events & timersWhether the handler is still subscribed.
  • timer:active()Events & timersWhether the timer is still pending. A one-shot timer is not active any more once it has fired.
  • ent:address()Players & entitiesWhere the entity lives in memory. For mem and nothing else.
  • after( seconds, handler )Events & timersCalls handler once, seconds from now.
  • ent:aim_punch()Players & entitiesThe recoil punch of the local player, as the engine applies it to the view. nil for anybody else.
  • ent:alive()Players & entities
  • p:alive()Game, console & soundWhether the effect exists - false after destroy().
  • c:alpha( a )MathThe same colour with a new alpha, 0 to 255.
  • ent:ammo()Players & entitiesRounds in the magazine.
  • math.angle_diff( from, to )MathThe shortest signed turn from one angle to the other, in degrees, in -180..180.
  • vec3.angle_to( from, to )MathThe angles that look from the point from at the point to.
  • cmd:angles()Editing the commandThe view angles the command carries: x is the pitch (positive looks down), y the yaw, z the roll, in degrees. If the command carries none yet, the player's current view a
  • ent:angles()Players & entitiesHow the body is rotated in the world - not where the player looks, see eye_angles.
  • game.angles()Game, console & soundThe view angles the game is using right now.
  • v:angles()Camera & projectionThe camera's angles.
  • v:angles()MathTreating v as a direction, the pitch and yaw that look along it - angles with z (roll) 0.
  • view.angles()Camera & projectionWhich way it looks.
  • bits.any( value, mask )Files, data & networktrue when at least one bit of mask is set in value.
  • cmd:any( mask )Editing the commandtrue when at least one button of mask is held.
  • fs.append( path, data )Files, data & networkAdds data to the end of the file, creating it if it is not there.
  • math.approach( current, target, step )MathMoves current toward target by at most step and never past it - for smooth following, with step = speed * render.dt().
  • ent:armor()Players & entities
  • ent:armor_ratio()Players & entities

B

  • bits.band( a, b, ... )Files, data & network
  • esp:bar( side, fraction, color [, options] )Cheat integrationA bar along a side of the box, filled to fraction (0 to 1). It is stacked with the overlay's own bars: a bar on the left goes outside the health bar, not over it. options
  • s:bind()Cheat integrationFor a toggle with a hotkey: { key, key_name, mode, active } - the virtual key, its name, the mode ("toggle", "hold", "hold_off") and whether the bind is active right now.
  • c:blur( x, y, w, h [, rounding [, tint]] )DrawingDraws the picture behind the rectangle - the game and everything drawn earlier in the frame - blurred. tint multiplies the blurred picture (white, untouched, by default);
  • bits.bnot( a )Files, data & networkEvery bit flipped.
  • ent:bomb()Players & entitiesFor the planted bomb entity - see ents.bomb() - its state as a table; nil for any other entity.
  • ents.bomb()Players & entitiesThe planted bomb, or nil. ent:bomb() reads its timers.
  • ent:bone( id )Players & entitiesThe world position of a bone. id is 0 to 26; ents.bone has the names - ents.bone.head, ents.bone.pelvis.
  • cv:bool()Game, console & soundRead the value as that type, whatever the convar's own type is.
  • ev:bool( key )Events & timersA field read as an integer and compared with zero. A field the game stores as a real boolean may read as false whatever it holds; if that happens, use ev:int.
  • bits.bor( a, b, ... )Files, data & network
  • ent:box()Players & entitiesThe rectangle the player covers on screen: { x, y, x2, y2, w, h } in pixels - top left corner, bottom right corner, size. nil when the player cannot be projected.
  • esp:box()Cheat integrationThe player's rectangle on screen: { x, y, w, h } in pixels.
  • render.builtin_font( name [, size] )DrawingOne of the cheat's own faces, ready to use. name is "ui", "ui_bold", "display", "lokeya", "icons" or "pixel"; size is "small", "normal" (the default) or "large". An unkno
  • world.bullet( from, direction [, options] )Traces & damageRuns the engine's bullet simulation from from along direction with the data of a weapon, and reports what the walls do to the bullet.
  • ent:bullets()Players & entitiesHow many bullets one shot fires - 1 for rifles, more for shotguns.
  • g:button( label, handler )Menus & controlsA button. handler is called, with no arguments, when it is clicked.
  • cmd:buttons()Editing the commandThe buttons held in this command.
  • bits.bxor( a, b, ... )Files, data & networkBitwise AND, OR and exclusive OR of any number of integers.
  • ents.by_class( name )Players & entitiesEvery entity of one class, found by walking the entity list - for example ents.by_class( "C_PlantedC4" ). The list is capped at 1024 entries. Class names are the game's o

C

  • c == dMathtrue when all four channels are equal.
  • mem.call( address, returns, ... )Files, data & networkCalls native code at address with up to eight arguments, all of the integer kind: integers, booleans, pointers, and strings (passed as pointers that stay valid for the ca
  • subscription:cancel()Events & timersStops the handler from being called. Returns true if it was still subscribed, false if it had already been cancelled.
  • timer:cancel()Events & timersCancels the timer. true if it was still pending.
  • cheat.categories()Cheat integrationEvery category, as a list of strings.
  • game.chat( text )Game, console & soundPrints a line in your local chat window. Nothing is sent to the server or to other players.
  • g:choice( label, items [, default_index] )Menus & controlsOne of several, from a drop-down. items is a non-empty list of strings. get() is the picked index, counting from 1; value() is the picked text.
  • c:circle( x, y, radius, color [, thickness [, segments]] )DrawingThe outline of a circle around x, y. segments is the number of straight pieces it is made of; 0, the default, picks a number that looks round at that radius.
  • math.clamp( v, lo, hi )Mathv limited to the range.
  • ent:class()Players & entitiesThe game's class name for it: "C_CSPlayerPawn", "CCSPlayerController", "C_AK47", "C_PlantedC4". An empty string when the entity is gone.
  • store.clear()Files, data & networkForgets everything.
  • c:click()Menus & controlsPresses a button from code, calling its handler. Only buttons have one.
  • c:clip( x, y, w, h [, absolute] )DrawingEverything drawn from now until the matching c:unclip() is cut off outside the rectangle. Clips nest: a second clip inside the first is the overlap of the two. With absol
  • color( r, g, b [, a] )MathMakes a colour. Channels outside 0..255 are clamped; alpha is 255 if left out. color() is opaque white.
  • g:color( label [, default [, alpha]] )Menus & controlsA colour picker. default is a colour, white if left out; alpha (default true) says whether the picker has an alpha channel. get() is a colour.
  • game.command( text )Game, console & soundRuns a console command, as if you had typed it: game.command( "echo hello" ). It goes through the game's own command system, so it is subject to the same rules as typing
  • table.contains( list, value )Files, data & networkWhether any value in the table equals value.
  • ent:controller()Players & entitiesThe controller of a player, given either entity.
  • c:copy()Math
  • table.copy( source )Files, data & networkA shallow copy: the same values under the same keys.
  • v:copy()MathA new vector with the same components.
  • bits.count( value )Files, data & networkHow many bits are set.
  • hash.crc32( text )Files, data & networkThe standard CRC-32 of the bytes.
  • v:cross( other )Math
  • game.curtime()Game, console & soundThe game's clock, in seconds: the time the game logic itself runs on. It is what times such as weapon:next_attack() and bomb.blow_time are measured against, so use it - n
  • g:custom{ options }Menus & controlsA rectangle of your own, filled by a function you write. See Custom controls.
  • game.cvar( name )Game, console & soundFinds a convar by name; nil if the game has none. Lookups are remembered, so asking again is cheap.
  • ent:cycle_time()Players & entitiesSeconds between two shots.

D

E

  • c:enable( [enabled] )Menus & controlsEnables or disables it. A disabled control is shown as plain dim text - its label and current value - and cannot be changed.
  • base64.encode( text )Files, data & network
  • json.encode( value [, pretty] )Files, data & networkTurns a value into JSON text. Tables follow the same rule as in store.set: keys 1..n make a list, anything else an object. With pretty = true the text is indented by two
  • string.ends_with( text, suffix )Files, data & network
  • ent:enemy()Players & entitiesWhether the entity is on the other team than the local player. In modes without teams everyone else counts as an enemy. false for an entity that is gone.
  • esp:enemy()Cheat integrationWhether the player is on the other team than you.
  • s:error()ShadersThe compiler's message if the shader did not compile, otherwise nil. The same message goes to the Scripts tab output, with line numbers from your source. A shader that fa
  • espEvents & timersOnce for every player the overlay draws, right after the built-in elements - box, bars, name, weapon, flags. player is the player's controller as an entity; esp is an obj
  • every( seconds, handler )Events & timersCalls handler repeatedly, every seconds. The period is at least a millisecond. The next call is scheduled before the handler runs, so a slow handler does not stretch the
  • fs.exists( path )Files, data & network
  • mem.export( module_base, name )Files, data & networkThe address of a function a module exports.
  • ent:eye()Players & entitiesWhere the player's eyes are: the origin plus the view offset. The point a trace to or from a player should start at.
  • ent:eye_angles()Players & entitiesWhere a player is looking: pitch, yaw, roll in degrees.

F

G

  • c:get( [item] )Menus & controlsThe control's value:
  • cheat.get( category, name )Cheat integrationThe current value of a setting. What you get depends on the setting's type:
  • clipboard.get()Files, data & networkThe text on the clipboard; nil if there is none.
  • cv:get()Game, console & soundThe value in the convar's own type: a boolean, an integer, a number or a string; nil for a type the runtime does not know. It relies on type(); if it answers nil where yo
  • ents.get( index )Players & entitiesThe entity in a slot of the entity list, 0 to 16383.
  • net.get( url [, options], handler )Files, data & networkFetches an address without waiting: the call returns at once with true, and handler( response ) is called a frame or two later, on the render thread, when the answer is i
  • s:get()Cheat integrationThe same as cheat.get.
  • store.get( key [, default] )Files, data & networkThe saved value, or default (nil if omitted) when there is none. The value you get is a fresh copy: changing it does not change what is stored until you set it again.
  • render.gif( path )DrawingAn animated GIF. It advances by itself while it is being drawn; texture:frames() and texture:restart() control it.
  • c:glow( x, y, w, h, color [, rounding] )DrawingA soft light in color around a rectangle. The rectangle is drawn into a separate pass, blurred, and added to the screen underneath everything else the cheat draws this fr
  • ent:ground_entity()Players & entitiesWhat the player is standing on.
  • t:group( title )Menus & controlsA group inside a particular tab.
  • ui.group( title )Menus & controlsA titled block of controls in the script's page. If the script has not made a tab, the group goes into a tab the runtime makes for it, named like the script; otherwise in
  • w:group( title )Menus & controlsA group inside the window.

H

  • ent:handle()Players & entitiesThe entity's handle, for ents.from_handle. 0 when it is gone.
  • bits.has( value, mask )Files, data & networktrue when every bit of mask is set in value.
  • ent:has_bomb()Players & entitiesWhether the player is carrying the bomb.
  • ent:has_defuser()Players & entities
  • font:has_glyph( codepoint )DrawingWhether the font carries a glyph for a Unicode code point, such as 0x2764.
  • ent:has_helmet()Players & entities
  • ent:headshot_multiplier()Players & entities
  • ent:health()Players & entities
  • c:hex( [with_alpha] )Math"rrggbb", or "rrggbbaa" with with_alpha = true.
  • color.hex( text )MathFrom a hex string: "ff8800", "#ff8800", or with alpha "ff8800cc".
  • ent:hitboxes()Players & entitiesThe player's hitboxes: a list of { index, bone, group, mins, maxs, radius } - the hitbox's number, the bone it follows, its hitgroup (see ents.hitgroup), its corners rela
  • input.hotkeys()InputThe cheat's own hotkeys: every setting that has a key bound, in the order they were registered, as { name, category, key, key_name, mode, active } - useful for drawing a
  • c:hsv()MathHue in degrees, saturation and value from 0 to 1, and the alpha as it is.
  • color.hsv( h, s, v [, a] )MathFrom hue (degrees, any number - it wraps), saturation and value (0 to 1), and an optional alpha in 0 to 255.

I

  • esp:icon( side, texture [, tint [, size]] )Cheat integrationA picture beside the box - a texture or a render.icon. size is the width in pixels (the height follows the picture's proportions); without it the picture's own size is us
  • render.icon( name [, scale] )DrawingOne of the game's own item icons, by name: a weapon name as ent:weapon_name() returns it ("ak47", "awp", "knife"), "c4", "planted_c4", "defuser", "hegrenade", "molotov",
  • c:image( texture, x, y, w, h [, tint [, rounding]] )DrawingDraws a texture stretched into the rectangle. tint multiplies the picture (white, untouched, by default) - lower its alpha to fade the image. A texture that is not ready
  • g:image( texture [, width [, height]] )Menus & controlsA picture in the group - a texture. Without sizes it is shown at the picture's own size; width and height override either one. The width is limited to what the group has
  • c:image_uv( texture, x, y, w, h, u0, v0, u1, v1 [, tint] )DrawingDraws part of a texture: u0, v0 to u1, v1 are the corners of the part, each from 0 to 1. For sprite sheets and for cropping.
  • cmd:impulse()Editing the command
  • game.in_game()Game, console & soundWhether there is a local player - you are in a map, not on the main menu.
  • ent:inaccuracy()Players & entitiesThe engine's current inaccuracy for the weapon - the value a shot's spread is scaled by. Asking does not disturb the weapon's own state.
  • ent:index()Players & entitiesThe entity's index in the entity list; -1 if it cannot be worked out, nil if the entity is gone.
  • g:input( label [, default [, options]] )Menus & controlsA line of text. options.max is the longest text it takes (1 to 1024, 128 by default); options.hint is the grey text shown while it is empty. get() is the text.
  • inputEvents & timersWindow messages: key presses, typed text, mouse buttons, wheel and movement. The handler runs on the window's own thread, before the menu and before the game see the mess
  • ev:int( key [, default] )Events & timersAn integer field. default (0 if left out) is returned when the event has no such field.
  • math.inv_lerp( a, b, v )MathWhere v sits between a and b, as t for lerp: the inverse of lerp. Not clamped; 0 if a == b.
  • ent:is( class )Players & entitiesWhether the entity's class is exactly class.
  • ent:is_grenade()Players & entities
  • ent:is_gun()Players & entitiesPistols, SMGs, rifles, shotguns, snipers and machine guns.
  • ent:is_knife()Players & entities
  • ui.is_open()Menus & controlsWhether the menu is showing.
  • w:is_open()Menus & controls
  • v:is_zero()Math
  • c:items( list )Menus & controlsReplaces the entries of a choice, a multi or a list with a new list of strings. The picked index is kept as far as it still fits; a multi keeps its ticks when the number

J

  • game.js( code )Game, console & soundRuns JavaScript in the game's own user-interface (Panorama) context - the HUD panel's script environment, the one the scoreboard is built with. Nothing happens if the int

K

  • c:key()Menus & controlsThe virtual key bound to a toggle's hotkey, or the key of a key control; 0 when there is none.
  • g:key( label [, key [, mode]] )Menus & controlsA key binding. key is a virtual key, 0 (none) by default; the user rebinds it in the menu. mode is "hold" (the default - active while the key is down), "toggle" (each pre
  • input.key_name( key )InputA readable name for a virtual key - what the menu shows on a key button.
  • store.keys()Files, data & networkEvery key currently stored.
  • table.keys( source )Files, data & networkThe keys, or the values, as a list - in no particular order.
  • c:kind()Menus & controls"toggle", "slider", "choice", "multi", "color", "text", "key", "button", "label", "spacer", "separator", "list", "image" or "custom".
  • ent:kind()Players & entities"controller", "pawn", "weapon", "projectile", "other", or "none" when the entity is gone.

L

M

  • game.map()Game, console & soundThe short name of the loaded map, such as "de_mirage"; nil outside a map.
  • map_loadEvents & timersA map is being loaded. name is the map's short name, for example de_mirage.
  • map_unloadEvents & timersThe map is going away. The state of the map is still there to read.
  • world.maskTraces & damageTwo ready-made collision masks to pass as mask:
  • ent:max_ammo()Players & entitiesThe magazine size.
  • ent:max_speed()Players & entitiesHow fast the weapon lets its owner run, for the mode - scoped or not - it is in right now.
  • c:measure( text [, font] )DrawingHow big text would be if drawn with c:text, in pixels. Use it to size a panel around its text or to right-align something.
  • font:measure( text )DrawingThe size of text in this font. The glyph atlas belongs to the render thread, so this answers nil anywhere else and before the font is built; inside a frame handler it alw
  • menuEvents & timersThe menu was opened (open is true) or closed (false).
  • c:mix( other, t )MathA blend, t from 0 (this colour) to 1 (the other); alpha is blended too.
  • fs.mkdir( path )Files, data & networkCreates a folder and the ones above it. true if it exists afterwards.
  • mem.module( name )Files, data & networkThe base address of a loaded module: mem.module( "client.dll" ).
  • mem.module_size( base )Files, data & networkThe size of a loaded module in bytes.
  • ent:money()Players & entities
  • cmd:mouse()Editing the commandThe mouse movement the command carries.
  • input.mouse()InputThe mouse cursor's position in the game window, in pixels from its top left corner.
  • cmd:move()Editing the command
  • moveEvents & timersOnce per command build, on the game thread, before the cheat's own features run. That ordering is the point. The usual shape of a script here is read the situation, then
  • move_postEvents & timersThe same command, after every feature has had its say and right before it is finalised. The last word on buttons, angles and movement. The input history has already been
  • ent:move_type()Players & entitiesThe movement type - walking, flying, noclip, on a ladder. See ents.move_type.
  • time.ms()Files, data & networkMilliseconds on a clock that only moves forward, with sub-millisecond precision. Good for measuring how long something took.
  • g:multi( label, items [, defaults] )Menus & controlsAny number of several, from a drop-down of checkboxes. defaults is a list of booleans. get() is a list of booleans, one per item; get( 2 ) is the second one alone; value(
  • hash.murmur2( text [, seed] )Files, data & networkThe 32-bit MurmurHash2, with an optional seed.

N

O

  • ent:observer_target()Players & entitiesWho a spectating player is watching.
  • off( subscription )Events & timersCancels a subscription. The same as subscription:cancel().
  • ents.offset( class, field )Players & entitiesWhere a field sits inside its class, in bytes; nil when the game has no such field. Offsets are looked up once and remembered.
  • on( name, handler )Events & timersCalls handler every time the event name happens. name is one of the cheat's events below, or "game:" followed by the name of an event of the game itself (see game events)
  • c:on_change( handler )Menus & controlsCalls handler( control ) after the user changes the control in the menu. c:on_change( nil ) takes the handler away.
  • ent:on_ground()Players & entities
  • w:open()Menus & controlsOpen, close or flip the window. Opening a window that is already open is harmless.
  • util.open_url( url )Files, data & networkOpens an address in the default browser. Only http:// and https:// addresses are accepted.
  • ent:origin()Players & entitiesThe entity's position in the world. For a player it is the point between the feet.
  • v:origin()Camera & projectionThe camera's position.
  • view.origin()Camera & projectionWhere the camera is.
  • ent:owner()Players & entitiesThe entity that holds or threw this one: the player carrying a weapon, the one who threw a grenade.

P

  • game.particle( path [, options] )Game, console & soundCreates a particle effect from a .vpcf resource of the game - "particles/embedded/snow.vpcf", for instance - and positions it. nil if the effect could not be created.
  • c:path( points, color [, closed [, thickness]] )DrawingA connected line through the points - a graph, a trail, an outline. closed joins the last point back to the first. At least two points.
  • script.path( relative )Files, data & networkAn absolute path to something inside the script's folder: script.path( "log/today.txt" ). Refuses .., drive letters and leading slashes, so a path built this way cannot l
  • c:path_gradient( points, colors [, closed [, thickness]] )DrawingA path whose colour changes along it: colors has one colour per point. If there are fewer colours than points, nothing is drawn.
  • mem.pattern( module, pattern )Files, data & networkFinds a byte pattern in a module and returns an address, using the cheat's own pattern syntax. The pattern is up to 128 bytes of hex pairs - spaces are allowed - with ? f
  • ent:pawn()Players & entitiesThe body of a player, given either entity.
  • ev:pawn( key )Events & timersThe same, as the player's pawn.
  • ent:penetration()Players & entities
  • ent:ping()Players & entities
  • game.play_file( path )Game, console & soundPlays a .wav file from the script's folder through the system mixer - independent of the game's own sound. true if the file exists and was started, false otherwise. Only
  • ev:player( key )Events & timersThe controller of the player a user-id field points to - "userid", "attacker", "assister". nil when there is none, for instance when the attacker was the world.
  • ents.players( [options] )Players & entitiesThe players' controllers, as a list. With no options that is everybody, the local player included. options filters:
  • p:point( index, position )Game, console & soundMoves one of the effect's control points.
  • c:polygon( points, color [, filled [, thickness]] )DrawingA convex polygon, filled by default, or outlined with filled = false. points is a flat list { x1, y1, x2, y2, ... } or a list of vec2, at least three points and at most 1
  • ev:position( [prefix] )Events & timersThe fields x, y and z of the event as a point - what bullet_impact carries. With a prefix it reads <prefix>x, <prefix>y and <prefix>z.
  • w:position( [x, y] )Menus & controlsMoves the window when given coordinates, and returns where it is now.
  • net.post( url, body [, options], handler )Files, data & networkThe same, sending body (a string, up to 8 MB) with a POST. Add a Content-Type header yourself when the server needs one.
  • cmd:press( mask )Editing the commandHolds the buttons in mask down in this command, as if the key was pressed.
  • input.pressed( key )Inputtrue once, on the call that sees the key go down. Each script remembers, per key, what it saw the last time it asked, so the answer depends on the calls this script makes
  • view.project( position )Camera & projectionWhere a world point lands on the screen. position is a vec3. Returns four values:
  • ents.projectiles()Players & entitiesGrenades in flight, smokes and fires.
  • ent:prop( class, field, type [, byte_offset] )Players & entitiesReads a field.
  • ent:prop_entity( class, field )Players & entitiesA handle field, resolved to the entity it points to.

R

  • util.random_hex( [bytes] )Files, data & networkbytes random bytes from the system's random number source, as lowercase hex - twice as many characters. 1 to 256 bytes, 16 by default. For identifiers and nonces. For gam
  • ent:range()Players & entities
  • ent:range_modifier()Players & entitiesThe fraction of damage that remains after each 500 units - 1 means no falloff.
  • fs.read( path )Files, data & networkThe whole file as a string. nil and a message - that path is outside the script's folder, cannot open the file, the file is too large - when it cannot be read. Files over
  • mem.read( address, type )Files, data & networkReads a value. type is "bool", "i8", "u8", "i16", "u16", "i32" ("int"), "u32", "i64" ("ptr", "u64"), "f32" ("float"), "f64" ("double") or "vec3". nil if the memory cannot
  • mem.read_bytes( address, count )Files, data & networkcount bytes (up to 1 MB) as a string, or nil if any of them cannot be read.
  • font:ready()DrawingWhether the font has been built yet. A font that is not ready draws nothing - and a font that failed to build never becomes ready.
  • s:ready()ShadersWhether the shader has compiled and can be used. Until then drawing with it is ignored - the shape is simply drawn with the normal shader, so check ready() first if that
  • texture:ready()DrawingWhether it has been uploaded and can be drawn.
  • view.ready()Camera & projectionWhether the game has produced a camera yet. Before it has - on the main menu, while a map loads - the other calls have nothing meaningful to answer, and project answers n
  • game.realtime()Game, console & soundSeconds on a clock that only moves forward, whatever the game does. The same clock as render.time().
  • ent:recoil_index()Players & entities
  • cmd:release( mask )Editing the commandLets the buttons in mask go in this command.
  • input.released( key )Inputtrue once when the key comes up. It shares its memory with input.pressed for the same key.
  • ent:reloading()Players & entities
  • math.remap( v, from_lo, from_hi, to_lo, to_hi )MathMaps v from one range to another, clamped to the new range.
  • fs.remove( path )Files, data & networkDeletes a file or an empty folder.
  • c:rename( text )Menus & controlsChanges the label that is shown. The control keeps its saved value, because values are stored under the label it was created with.
  • ent:reserve_ammo()Players & entitiesRounds in reserve.
  • texture:restart()DrawingStarts an animated GIF from its first frame.
  • v:right()Math
  • cmd:rotate_move( from_yaw, to_yaw )Editing the commandThe movement in the command was meant for a view looking along from_yaw. This rewrites it so it produces the same direction in the world for a view looking along to_yaw.
  • math.round( v [, digits] )MathRounds to the nearest integer, or to digits decimals (0 to 12).
  • ents.rules()Players & entitiesThe game rules, as { freeze_period, team_intro, round_start_time, phase }: whether the round is in its freeze period, whether the team intro is playing, the game time the

S

  • cheat.save_config( name )Cheat integrationSaves the cheat's whole state as the config name. true on success.
  • ent:scoped()Players & entities
  • c:screen()DrawingThe size of the screen in pixels.
  • game.screen()Game, console & soundThe size of the game's picture in pixels.
  • render.screen()DrawingThe same, without a canvas.
  • cmd:seed()Editing the commandThe command's random seed.
  • cmd:select_weapon( weapon )Editing the commandSwitches to a weapon the player owns. weapon is a weapon entity - from ent:weapons(). Answers true when the switch was put into the command and false when the weapon's sl
  • g:separator()Menus & controlsA thin dividing line.
  • game.server_tick()Game, console & soundThe newest server tick the client has heard of.
  • bits.set( value, mask )Files, data & networkvalue with the bits of mask switched on, or off.
  • c:set( value )Menus & controlsChanges the value, with the same shapes as get() returns: a boolean, a number (clamped to the slider's range), an index, a colour, a string, a key code. For a multi, set(
  • cheat.set( category, name, value )Cheat integrationChanges a setting. The value has to suit the setting's type - a boolean for a toggle, a number for a slider, a colour for a colour - otherwise nothing changes and the ans
  • clipboard.set( text )Files, data & networkPuts text on the clipboard.
  • cv:set( value )Game, console & soundWrites the value in the convar's own type. The engine is not told the value changed: change callbacks do not run, and a convar the server controls stays what the server s
  • s:set( slot, x [, y [, z [, w]]] )ShadersSets one of the eight parameters, p[slot] in the shader. slot is 0 to 7; anything you leave out is 0.
  • s:set( value )Cheat integrationThe same as cheat.set, but a value that does not fit raises an error instead of answering false. Returns the setting, so calls chain.
  • store.set( key, value )Files, data & networkSaves value under key. The value has to be something JSON can hold: nil (which removes the key), booleans, numbers, strings, and tables of those. A table whose keys are e
  • v:set( x, y, z )MathChanges v in place and returns it. The only method that does; everything else returns a new vector.
  • cmd:set_angles( angles [, silent] )Editing the commandWrites the angles the command is sent with. silent is true by default.
  • game.set_angles( angles )Game, console & soundTurns the player's view. Pitch is kept within ±89 and the roll is zeroed. If you call it from a thread other than the game's, the change is queued and applied at the next
  • v:set_angles( angles )Camera & projectionTurns the camera without turning the player: the game's picture changes, the command and the server's view of where you look do not.
  • s:set_bind( key [, mode] )Cheat integrationBinds a key to a toggle; a key of 0 removes the bind. mode is "toggle", "hold" or "hold_off"; leave it out to keep the current one. Raises an error on a setting that is n
  • cv:set_bool( b )Game, console & soundWrite the value as that type.
  • cmd:set_buttons( mask )Editing the commandReplaces the whole set. The game is told which buttons changed.
  • v:set_fov( degrees )Camera & projectionSets the field of view, clamped to 1 to 170 degrees.
  • cmd:set_impulse( n )Editing the commandThe command's impulse: 0 for none, 100 flashlight, 201 spray paint.
  • c:set_key( key [, mode] )Menus & controlsBinds a key. On a toggle, mode is "toggle", "hold" or "hold_off"; on a key control it is "hold", "toggle" or "always". Leave it out to keep the current mode.
  • cmd:set_move( forward, left [, up] )Editing the commandSets the movement. Values are clamped to -1..1. CS2 normally moves a player from the sub-tick steps attached to a command, which tell the exact moment each key changed; w
  • v:set_origin( position )Camera & projectionMoves the camera. The player does not move - only what you see does.
  • ent:set_prop( class, field, type, value [, byte_offset] )Players & entitiesWrites a field; true if it was written. Writing works for bool, the integer and float types, vec3, color and ptr. A write goes straight into the game's memory - the clien
  • c:set_range( min, max )Menus & controlsChanges the range of a slider. The value is clamped into it.
  • c:shader( shader | nil )ShadersEverything the canvas draws after this call - until the next c:shader call or until the callback ends - is drawn with the shader. c:shader( nil ) goes back to the normal
  • render.shader( source [, options] )ShadersCreates a shader from HLSL source. Nothing is compiled yet: that happens on the first frame the shader is needed, which costs a few milliseconds, so make shaders once, wh
  • bits.shl( a, n )Files, data & networkShift left or right by n bits. Both are logical - zeros are shifted in, also for negative numbers - and a count of 64 or more gives 0.
  • ent:shots_fired()Players & entities
  • c:show( [visible] )Menus & controlsShows or hides the control. show() and show( true ) show it; show( false ) hides it. A hidden control keeps its value and is still saved.
  • math.sign( v )Math-1, 0 or 1.
  • ent:simulation_time()Players & entities
  • font:size()DrawingThe size in pixels the font was made at.
  • fs.size( path )Files, data & networkThe file's size in bytes; nil if it does not exist or the path is not allowed.
  • texture:size()DrawingThe size in pixels. For an image that has not been built yet this is 0, 0 - ask again once the texture is ready.
  • ent:skeleton()Players & entitiesAll the bones at once: a table from bone id to position, { [0] = vec3, [1] = vec3, ... [26] = vec3 }. The keys are bone ids, so the table starts at 0.
  • g:slider( label, min, max [, default [, options]] )Menus & controlsA slider between min and max; default is where it starts (the minimum if left out). options:
  • math.smoothstep( t )MathAn S-curve from 0 to 1 for t in 0..1.
  • game.sound( path [, volume] )Game, console & soundPlays one of the game's sounds by its path - "sounds/ui/coin_pickup_01", "sounds/ui/killcard_1" and "sounds/training/timer_bell" are three that exist. volume is a percent
  • g:spacer( [height] )Menus & controlsEmpty space, 8 pixels high unless you say otherwise (0 to 400).
  • ent:speed()Players & entitiesThe speed in units per second, vertical movement included.
  • ent:speed2d()Players & entitiesThe horizontal speed - the one that matters for bunny hopping and for accuracy.
  • string.split( text, separator [, plain] )Files, data & networkCuts text at every separator. The separator is searched for as plain text unless plain is false, in which case it is a Lua pattern. An empty or missing separator splits i
  • ent:spotted()Players & entitiesThe game's own "spotted" flag for the player.
  • ent:spread()Players & entitiesThe weapon's base spread.
  • game.stageGame, console & soundA table naming the frame stages the cheat itself reacts to, for the stage event: game.stage.net_commit (6), game.stage.pre_render (7) and game.stage.render_start (12).
  • stageEvents & timersCalled around the game's frame-stage callback - stage just before the game's own handler for that stage, stage_post just after - with the stage number, once for every sta
  • stage_postEvents & timersThe same, after the game's own handler has run.
  • ent:stamina()Players & entities
  • string.starts_with( text, prefix )Files, data & network
  • cheat.state()Cheat integrationA snapshot of what the cheat's features are doing right now, for a script that draws it or reacts to it:
  • ent:steam_id()Players & entitiesThe 64-bit Steam id; 0 for bots.
  • mem.string( address [, max] )Files, data & networkThe zero-terminated string at an address, up to max bytes (256 by default).
  • render.svg( markup_or_path [, scale] )DrawingA vector image rasterised once at scale (1 by default; 0.05 to 16). A string that starts with < is the SVG markup itself; anything else is the path of a file in the sc

T

  • ui.tab( title )Menus & controlsA page of groups. A script with several tabs shows a row of buttons above its controls to switch between them. Groups made with ui.group afterwards go into the newest tab
  • ent:team()Players & entitiesThe team number: 1 spectators, 2 terrorists, 3 counter-terrorists, 0 none yet.
  • c:text( x, y, text, color [, options] )DrawingDraws text with its top left corner at x, y. Newlines in text start new lines; the text is UTF-8. options is an optional table:
  • esp:text( side, text, color [, options] )Cheat integrationA line of text on a side of the box, outlined for legibility. Lines on the top and bottom are centred on the box; lines on the left and right stack down the side, one und
  • c:text_runs( x, y, runs [, options] )DrawingConsecutive pieces of text, each in its own colour, laid out left to right as one line. runs is a list of { text, color } pairs; options is the same table as for c:text,
  • render.texture( path )DrawingLoads an image file - PNG, JPEG, BMP, TIFF and whatever else Windows' own image codecs can decode. nil and a message if the file cannot be read. Files larger than 32 MB a
  • render.texture_data( bytes )DrawingAn encoded image that is already in memory as a string - from fs.read or a download.
  • render.texture_rgba( width, height, pixels )DrawingA texture from raw pixels: 8 bits each of red, green, blue and alpha, row after row, so pixels is exactly width height 4 bytes long. At most 8192 by 8192. A way to draw h
  • ui.theme()Menus & controlsThe menu's colours, so a script can match them: a table of colours with the keys accent, text, text_dim, window, child, button, checkbox, slider, card and elevated.
  • cmd:tick()Editing the commandThe client tick the command was built for.
  • game.tick()Game, console & soundThe client's tick counter.
  • ent:tick_base()Players & entitiesThe player's tick base - the tick their movement has been simulated up to.
  • game.tick_intervalGame, console & soundThe length of a tick in seconds: 0.015625.
  • game.tickrateGame, console & sound64.
  • game.ticks_to_time( ticks )Game, console & soundConversions between seconds and ticks, at the game's 64 ticks per second.
  • render.time()DrawingSeconds on a clock that only moves forward, whose zero is arbitrary - use it for differences and animations, not as a date. For a calendar time see time.unix().
  • game.time_to_ticks( seconds )Game, console & sound
  • g:toggle( label [, default] )Menus & controlsA checkbox. get() is true or false. A toggle can also have a hotkey, set in the menu the way the cheat's own toggles get theirs or from code with c:set_key.
  • c:tooltip( text )Menus & controlsThe text shown when the pointer rests on the control.
  • world.trace( from, to [, options] )Traces & damageSends a ray from from to to and reports what it hits first. from and to are vec3 points in the world.
  • c:triangle( x1, y1, x2, y2, x3, y3, color [, filled [, thickness]] )DrawingA triangle. filled is true by default; with false only the outline is drawn, thickness pixels wide.
  • string.trim( text )Files, data & networkRemoves whitespace from both ends.
  • script.trustedFiles, data & networktrue when the script has been switched to trusted. A script can check it to explain itself - or to stay away from features it cannot have.
  • cv:type()Game, console & soundThe engine's numeric type id of the convar.
  • s:type()Cheat integrationOne of the types in the table above.

U

  • c:unclip()DrawingEnds the innermost clip.
  • time.unix()Files, data & networkSeconds since 1 January 1970, UTC. For readable dates the standard os.date and os.time work as usual.
  • unloadEvents & timersThe last call before the script's state is closed - when the script is reloaded or switched off, or the cheat shuts down. Put things back here: a convar the script change
  • c:unpack()Math
  • v:unpack()MathThe three components as three values.
  • v:unpack()Math
  • v:up()MathTreating v as a set of angles, the direction the view looks along, to its right, and upward. These are what turn "where am I looking" into a ray.

V

  • ent:valid()Players & entitiesWhether the entity still exists.
  • c:value()Menus & controlsLike get(), but a choice or a list answers the picked text, and a multi answers the list of picked texts. Everything else is the same as get().
  • vec2( x, y )Mathvec2() is 0, 0; vec2( other ) copies.
  • vec3( x, y, z )MathMakes a vector. vec3() is the zero vector; vec3( other ) copies one.
  • ent:velocity()Players & entities
  • ent:velocity_modifier()Players & entities1 for normal speed; below 1 while the player is slowed, for instance after being hit.
  • mem.vfunc( object, index )Files, data & networkThe address of the function in a slot of an object's virtual table. object is the object's address - ent:address() for an entity.
  • viewEvents & timersThe camera as it is about to be rendered, after the cheat's own camera work. view reads and writes the camera directly - see Camera & projection. It is only valid ins
  • ents.viewed()Players & entitiesWhose camera you are looking through: the local player's controller, or, while you are dead and spectating, the player you are watching.
  • ent:visible( [from] )Players & entitiesWhether the player's head can be seen from the camera - or from the point from, if given. A line is traced to the head, skipping the local player's own body.
  • esp:visible()Cheat integrationWhether the player is visible to you at the moment.
  • world.visible( from, to [, target [, skip]] )Traces & damageWhether the ray from from to to arrives unobstructed. target is an entity: if the ray is stopped by it, the end point still counts as visible - what you want when to is a

W

  • ent:walking()Players & entitiesWhether the game's walking flag is set - slow, quiet steps.
  • ent:weapon()Players & entitiesThe player's active weapon. Given a weapon, the weapon itself.
  • ent:weapon_id()Players & entitiesThe weapon's item definition index. ents.weapon_id has the names.
  • ents.weapon_idPlayers & entitiesItem definition indices by name:
  • ent:weapon_name()Players & entitiesThe weapon's name without the weapon_ prefix: "ak47", "awp", "knife", "c4". This is also what render.icon takes.
  • ent:weapon_type()Players & entitiesPistol, rifle, sniper, grenade - see ents.weapon_type.
  • ent:weapons()Players & entitiesEvery weapon the player carries.
  • ents.weapons( [options] )Players & entitiesWeapons lying in the world. With { dropped = true } only those nobody carries.
  • ui.window{ options }Menus & controlsA floating window, drawn over the menu. It is moved by its title strip, keeps the position you drag it to while the script runs, and belongs to the script - when the scri
  • c:wrap( text, max_width [, font] )DrawingBreaks text into a list of lines, none wider than max_width pixels. Lines are broken at spaces and at newlines; a single word longer than the width is cut inside the word
  • math.wrap( v, lo, hi )Mathv brought into the range [lo, hi), wrapping around.
  • math.wrap_angle( degrees )MathAn angle brought into -180..180.
  • v:wrapped()MathAngles brought into the legal range: yaw to -180..180, pitch limited to -89..89, roll 0.
  • fs.write( path, data )Files, data & networkWrites data to the file, replacing it, and creates the folders on the way. false if the path is not allowed or the file could not be written.
  • mem.write( address, type, value )Files, data & networkWrites a value of the same types; false if the memory cannot be written.
  • mem.write_bytes( address, data )Files, data & network