# Table of Contents - [Lua API / HrisitoSense](#lua-api-hrisitosense) --- # Lua API / HrisitoSense HrisitoSense API for Lua ------------------------ Table of contents ================= * [client.set\_event\_callback](https://hrisitosense.github.io/lua#client-set_event_callback) * [client.unset\_event\_callback](https://hrisitosense.github.io/lua#client-unset_event_callback) * [client.log](https://hrisitosense.github.io/lua#client-log) * [client.color\_log](https://hrisitosense.github.io/lua#client-color_log) * [client.error\_log](https://hrisitosense.github.io/lua#client-error_log) * [client.exec](https://hrisitosense.github.io/lua#client-exec) * [client.userid\_to\_entindex](https://hrisitosense.github.io/lua#client-userid_to_entindex) * [client.draw\_debug\_text](https://hrisitosense.github.io/lua#client-draw_debug_text) * [client.draw\_hitboxes](https://hrisitosense.github.io/lua#client-draw_hitboxes) * [client.random\_int](https://hrisitosense.github.io/lua#client-random_int) * [client.random\_float](https://hrisitosense.github.io/lua#client-random_float) * [client.screen\_size](https://hrisitosense.github.io/lua#client-screen_size) * [client.visible](https://hrisitosense.github.io/lua#client-visible) * [client.trace\_line](https://hrisitosense.github.io/lua#client-trace_line) * [client.trace\_bullet](https://hrisitosense.github.io/lua#client-trace_bullet) * [client.scale\_damage](https://hrisitosense.github.io/lua#client-scale_damage) * [client.delay\_call](https://hrisitosense.github.io/lua#client-delay_call) * [client.latency](https://hrisitosense.github.io/lua#client-latency) * [client.camera\_angles](https://hrisitosense.github.io/lua#client-camera_angles) * [client.camera\_position](https://hrisitosense.github.io/lua#client-camera_position) * [client.timestamp](https://hrisitosense.github.io/lua#client-timestamp) * [client.eye\_position](https://hrisitosense.github.io/lua#client-eye_position) * [client.set\_clan\_tag](https://hrisitosense.github.io/lua#client-set_clan_tag) * [client.system\_time](https://hrisitosense.github.io/lua#client-system_time) * [client.unix\_time](https://hrisitosense.github.io/lua#client-unix_time) * [client.reload\_active\_scripts](https://hrisitosense.github.io/lua#client-reload_active_scripts) * [client.create\_interface](https://hrisitosense.github.io/lua#client-create_interface) * [client.find\_signature](https://hrisitosense.github.io/lua#client-find_signature) * [client.key\_state](https://hrisitosense.github.io/lua#client-key_state) * [client.get\_model\_name](https://hrisitosense.github.io/lua#client-get_model_name) * [client.register\_esp\_flag](https://hrisitosense.github.io/lua#client-register_esp_flag) * [config.load](https://hrisitosense.github.io/lua#config-load) * [config.export](https://hrisitosense.github.io/lua#config-export) * [cvar.set\_string](https://hrisitosense.github.io/lua#cvar-set_string) * [cvar.get\_string](https://hrisitosense.github.io/lua#cvar-get_string) * [cvar.set\_float](https://hrisitosense.github.io/lua#cvar-set_float) * [cvar.set\_raw\_float](https://hrisitosense.github.io/lua#cvar-set_raw_float) * [cvar.get\_float](https://hrisitosense.github.io/lua#cvar-get_float) * [cvar.set\_int](https://hrisitosense.github.io/lua#cvar-set_int) * [cvar.set\_raw\_int](https://hrisitosense.github.io/lua#cvar-set_raw_int) * [cvar.get\_int](https://hrisitosense.github.io/lua#cvar-get_int) * [cvar.invoke\_callback](https://hrisitosense.github.io/lua#cvar-invoke_callback) * [database.write](https://hrisitosense.github.io/lua#database-write) * [database.read](https://hrisitosense.github.io/lua#database-read) * [entity.get\_local\_player](https://hrisitosense.github.io/lua#entity-get_local_player) * [entity.get\_all](https://hrisitosense.github.io/lua#entity-get_all) * [entity.get\_players](https://hrisitosense.github.io/lua#entity-get_players) * [entity.get\_game\_rules](https://hrisitosense.github.io/lua#entity-get_game_rules) * [entity.get\_player\_resource](https://hrisitosense.github.io/lua#entity-get_player_resource) * [entity.get\_classname](https://hrisitosense.github.io/lua#entity-get_classname) * [entity.set\_prop](https://hrisitosense.github.io/lua#entity-set_prop) * [entity.get\_prop](https://hrisitosense.github.io/lua#entity-get_prop) * [entity.is\_enemy](https://hrisitosense.github.io/lua#entity-is_enemy) * [entity.is\_alive](https://hrisitosense.github.io/lua#entity-is_alive) * [entity.is\_dormant](https://hrisitosense.github.io/lua#entity-is_dormant) * [entity.get\_player\_name](https://hrisitosense.github.io/lua#entity-get_player_name) * [entity.get\_player\_weapon](https://hrisitosense.github.io/lua#entity-get_player_weapon) * [entity.hitbox\_position](https://hrisitosense.github.io/lua#entity-hitbox_position) * [entity.get\_steam64](https://hrisitosense.github.io/lua#entity-get_steam64) * [entity.get\_bounding\_box](https://hrisitosense.github.io/lua#entity-get_bounding_box) * [entity.get\_origin](https://hrisitosense.github.io/lua#entity-get_origin) * [entity.get\_esp\_data](https://hrisitosense.github.io/lua#entity-get_esp_data) * [globals.realtime](https://hrisitosense.github.io/lua#globals-realtime) * [globals.curtime](https://hrisitosense.github.io/lua#globals-curtime) * [globals.frametime](https://hrisitosense.github.io/lua#globals-frametime) * [globals.absoluteframetime](https://hrisitosense.github.io/lua#globals-absoluteframetime) * [globals.maxplayers](https://hrisitosense.github.io/lua#globals-maxplayers) * [globals.tickcount](https://hrisitosense.github.io/lua#globals-tickcount) * [globals.tickinterval](https://hrisitosense.github.io/lua#globals-tickinterval) * [globals.framecount](https://hrisitosense.github.io/lua#globals-framecount) * [globals.mapname](https://hrisitosense.github.io/lua#globals-mapname) * [globals.lastoutgoingcommand](https://hrisitosense.github.io/lua#globals-lastoutgoingcommand) * [globals.oldcommandack](https://hrisitosense.github.io/lua#globals-oldcommandack) * [globals.commandack](https://hrisitosense.github.io/lua#globals-commandack) * [globals.chokedcommands](https://hrisitosense.github.io/lua#globals-chokedcommands) * [panorama.open](https://hrisitosense.github.io/lua#panorama-open) * [panorama.loadstring](https://hrisitosense.github.io/lua#panorama-loadstring) * [materialsystem.get\_name](https://hrisitosense.github.io/lua#materialsystem-get_name) * [materialsystem.reload](https://hrisitosense.github.io/lua#materialsystem-reload) * [materialsystem.color\_modulate](https://hrisitosense.github.io/lua#materialsystem-color_modulate) * [materialsystem.alpha\_modulate](https://hrisitosense.github.io/lua#materialsystem-alpha_modulate) * [materialsystem.set\_shader\_param](https://hrisitosense.github.io/lua#materialsystem-set_shader_param) * [materialsystem.get\_shader\_param](https://hrisitosense.github.io/lua#materialsystem-get_shader_param) * [materialsystem.set\_material\_var\_flag](https://hrisitosense.github.io/lua#materialsystem-set_material_var_flag) * [materialsystem.get\_material\_var\_flag](https://hrisitosense.github.io/lua#materialsystem-get_material_var_flag) * [materialsystem.find\_material](https://hrisitosense.github.io/lua#materialsystem-find_material) * [materialsystem.find\_materials](https://hrisitosense.github.io/lua#materialsystem-find_materials) * [materialsystem.find\_texture](https://hrisitosense.github.io/lua#materialsystem-find_texture) * [materialsystem.get\_model\_materials](https://hrisitosense.github.io/lua#materialsystem-get_model_materials) * [materialsystem.arms\_material](https://hrisitosense.github.io/lua#materialsystem-arms_material) * [materialsystem.chams\_material](https://hrisitosense.github.io/lua#materialsystem-chams_material) * [plist.set](https://hrisitosense.github.io/lua#plist-set) * [plist.get](https://hrisitosense.github.io/lua#plist-get) * [renderer.text](https://hrisitosense.github.io/lua#renderer-text) * [renderer.measure\_text](https://hrisitosense.github.io/lua#renderer-measure_text) * [renderer.rectangle](https://hrisitosense.github.io/lua#renderer-rectangle) * [renderer.line](https://hrisitosense.github.io/lua#renderer-line) * [renderer.gradient](https://hrisitosense.github.io/lua#renderer-gradient) * [renderer.circle](https://hrisitosense.github.io/lua#renderer-circle) * [renderer.circle\_outline](https://hrisitosense.github.io/lua#renderer-circle_outline) * [renderer.triangle](https://hrisitosense.github.io/lua#renderer-triangle) * [renderer.world\_to\_screen](https://hrisitosense.github.io/lua#renderer-world_to_screen) * [renderer.indicator](https://hrisitosense.github.io/lua#renderer-indicator) * [renderer.texture](https://hrisitosense.github.io/lua#renderer-texture) * [renderer.load\_svg](https://hrisitosense.github.io/lua#renderer-load_svg) * [renderer.load\_png](https://hrisitosense.github.io/lua#renderer-load_png) * [renderer.load\_jpg](https://hrisitosense.github.io/lua#renderer-load_jpg) * [renderer.load\_rgba](https://hrisitosense.github.io/lua#renderer-load_rgba) * [ui.new\_checkbox](https://hrisitosense.github.io/lua#ui-new_checkbox) * [ui.new\_slider](https://hrisitosense.github.io/lua#ui-new_slider) * [ui.new\_combobox](https://hrisitosense.github.io/lua#ui-new_combobox) * [ui.new\_multiselect](https://hrisitosense.github.io/lua#ui-new_multiselect) * [ui.new\_hotkey](https://hrisitosense.github.io/lua#ui-new_hotkey) * [ui.new\_button](https://hrisitosense.github.io/lua#ui-new_button) * [ui.new\_color\_picker](https://hrisitosense.github.io/lua#ui-new_color_picker) * [ui.new\_textbox](https://hrisitosense.github.io/lua#ui-new_textbox) * [ui.new\_listbox](https://hrisitosense.github.io/lua#ui-new_listbox) * [ui.new\_string](https://hrisitosense.github.io/lua#ui-new_string) * [ui.new\_label](https://hrisitosense.github.io/lua#ui-new_label) * [ui.reference](https://hrisitosense.github.io/lua#ui-reference) * [ui.set](https://hrisitosense.github.io/lua#ui-set) * [ui.get](https://hrisitosense.github.io/lua#ui-get) * [ui.set\_callback](https://hrisitosense.github.io/lua#ui-set_callback) * [ui.set\_visible](https://hrisitosense.github.io/lua#ui-set_visible) * [ui.is\_menu\_open](https://hrisitosense.github.io/lua#ui-is_menu_open) * [ui.mouse\_position](https://hrisitosense.github.io/lua#ui-mouse_position) * [ui.menu\_position](https://hrisitosense.github.io/lua#ui-menu_position) * [ui.menu\_size](https://hrisitosense.github.io/lua#ui-menu_size) * [ui.name](https://hrisitosense.github.io/lua#ui-name) ### client.set\_event\_callback **syntax:** _client.set\_event\_callback(event\_name, callback)_ `event_name` - Name of the event. `callback` - Lua function to call when this event occurs. Raises an error and prints a message in console upon failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.unset\_event\_callback **syntax:** _client.unset\_event\_callback(event\_name, callback)_ `event_name` - Name of the event `callback` - Lua function that was passed to set\_event\_callback Removes a callback that was previously set using `set_event_callback` [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.log **syntax:** _client.log(msg, ...)_ `msg` - The message `...` - Optional comma-separated arguments to concatenate with msg. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.color\_log **syntax:** _client.color\_log(r, g, b, msg, ...)_ `r` - Red (0-255) `g` - Green (0-255) `b` - Blue (0-255) `msg` - The message `...` - Optional comma-separated arguments to concatenate with msg. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.error\_log **syntax:** _client.error\_log(msg)_ `msg` - The error message [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.exec **syntax:** _client.exec(cmd, ...)_ `cmd` - The console command(s) to execute. `...` - Optional comma-separated arguments to concatenate with cmd. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.userid\_to\_entindex **syntax:** _client.userid\_to\_entindex(userid)_ `userid` - This is given by some game events. Returns the entity index, or 0 on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.draw\_debug\_text **syntax:** _client.draw\_debug\_text(x, y, z, line\_offset, duration, r, g, b, a, ...)_ `x` - Position in world space `y` - Position in world space `z` - Position in world space `line_offset` - Used for vertical alignment, use 0 for the first line. `duration` - Time in seconds that the text will remain on the screen. `r` - Red (1-255) `g` - Green (1-255) `b` - Blue (1-255) `a` - Alpha (1-255) `...` - The text that will be drawn Avoid calling this during the `paint` event. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.draw\_hitboxes **syntax:** _client.draw\_hitboxes(entindex, duration, hitboxes, r, g, b, a, tick)_ `entindex` - Entity index `duration` - Time in seconds `hitboxes` - Either the hitbox index, an array of hitbox indices, or 19 for all hitboxes `r` - Red (1-255) `g` - Green (1-255) `b` - Blue (1-255) `a` - Alpha (1-255) `tick` - Optional integer Draws hitbox overlays. Avoid calling this during the `paint` event. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.random\_int **syntax:** _client.random\_int(minimum, maximum)_ `minimum` - Lowest possible result `maximum` - Highest possible result Returns a random integer between minimum and maximum. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.random\_float **syntax:** _client.random\_float(minimum, maximum)_ `minimum` - Lowest possible result `maximum` - Highest possible result Returns a random float between minimum and maximum. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.screen\_size **syntax:** _client.screen\_size()_ Returns `(width, height)`. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.visible **syntax:** _client.visible(x, y, z)_ `x` - Position in world space `y` - Position in world space `z` - Position in world space Returns true if the position is visible. For example, you could use a player's origin to see if they are visible. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.trace\_line **syntax:** _client.trace\_line(skip\_entindex, from\_x, from\_y, from\_z, to\_x, to\_y, to\_z)_ `skip_entindex` - Ignore this entity while tracing `from_x` - Position in world space `from_y` - Position in world space `from_z` - Position in world space `to_x` - Position in world space `to_y` - Position in world space `to_z` - Position in world space Returns `fraction, entindex`. `fraction` is a percentage in the range \[0.0, 1.0\] that tells you how far the trace went before hitting something, so 1.0 means nothing was hit. `entindex` is the entity index that hit, or -1 if no entity was hit. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.trace\_bullet **syntax:** _client.trace\_bullet(from\_player, from\_x, from\_y, from\_z, to\_x, to\_y, to\_z, skip\_players)_ `from_player` - Entity index of the player whose weapon will be used for this trace `from_x` - Position in world space `from_y` - Position in world space `from_z` - Position in world space `to_x` - Position in world space `to_y` - Position in world space `to_z` - Position in world space `skip_players` - Optional, pass `true` to skip expensive hitbox checks. Returns `entindex, damage`. Entindex is `nil` when no player is hit or if players are skipped. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.scale\_damage **syntax:** _client.scale\_damage(entindex, hitgroup, damage)_ `entindex` - Player entity index `hitgroup` - Hit group index `damage` - Damage Returns adjusted damage for the specified hitgroup [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.delay\_call **syntax:** _client.delay\_call(delay, callback, ...)_ `delay` - Time in seconds to wait before calling `callback`. `callback` - The lua function that will be called after `delay` seconds. `...` - Optional arguments that will be passed to the callback. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.latency **syntax:** _client.latency()_ Returns your latency in seconds. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.camera\_angles **syntax:** _client.camera\_angles()_ Returns `pitch, yaw, roll` of where you are looking. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.camera\_position **syntax:** _client.camera\_position()_ Returns `x, y, z` world coordinates of the camera position. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.timestamp **syntax:** _client.timestamp()_ Returns high precision timestamp in milliseconds. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.eye\_position **syntax:** _client.eye\_position()_ Returns `x, y, z` world coordinates of the local player's eye position, or `nil` on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.set\_clan\_tag **syntax:** _client.set\_clan\_tag(...)_ `...` - The text that will be drawn The clan tag is removed if no argument is passed or if it is an empty string. Additional arguments will be concatenated similar to `client.log`. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.system\_time **syntax:** _client.system\_time()_ Returns `hour, minute, seconds, milliseconds`. local h, m, s, ms = client.system\_time() [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.unix\_time **syntax:** _client.unix\_time()_ Returns `hour, minute, seconds, milliseconds`. local time = client.unix\_time() [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.reload\_active\_scripts **syntax:** _client.reload\_active\_scripts()_ Reloads all scripts the following frame. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.create\_interface **syntax:** _client.create\_interface(module\_name, interface\_name)_ `module_name` - Filename of the module that contains the interface `interface_name` - Name of the interface Returns a pointer to the interface, or nil on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.find\_signature **syntax:** _client.find\_signature(module\_name, pattern)_ `module_name` - Filename of the module that contains the interface `pattern` - String in the form of `'\x01\x02\xCC\x03'` Finds the specified pattern and returns its address, or nil if not found. CC is wildcard. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.key\_state **syntax:** _client.key\_state(virtual\_key)_ `virtual_key` - Virtual key index Returns true if the key is pressed. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.get\_model\_name **syntax:** _client.get\_model\_name(model\_index)_ `model_index` - Model index Returns model name, or nil on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### client.register\_esp\_flag **syntax:** _client.register\_esp\_flag(flag, r, g, b, callback)_ `flag` - String of text that will be shown when callback returns true `r` - Red (1-255) `g` - Green (1-255) `b` - Blue (1-255) `callback` - Function that will be called for each entity while drawing the ESP Requires "Flags" is enabled in Player ESP [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### config.load **syntax:** _config.load(name, tab\_name, container\_name)_ `name` - Name of the config `tab_name` - Optional name of the tab `container_name` - Optional name of the container To load the specified config: `config.load('Config name here')` To load a tab from the specified config: `config.load('Config name here', 'Tab name here')` To load a container from the specified config: `config.load('Config name here', 'Tab name here', 'Container name here')` [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### config.export **syntax:** _config.export()_ Returns the current config as a string [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### cvar.set\_string **syntax:** _cvar.set\_string(value)_ `value` - String value [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### cvar.get\_string **syntax:** _cvar.get\_string()_ Returns nil on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### cvar.set\_float **syntax:** _cvar.set\_float(value)_ `value` - Float value `cvar.cl_interp_ratio:set_float(1)` [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### cvar.set\_raw\_float **syntax:** _cvar.set\_raw\_float(value)_ `value` - Float value This sets the float value without changing the integer and string values. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### cvar.get\_float **syntax:** _cvar.get\_float()_ Returns nil if called on a ConCommand. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### cvar.set\_int **syntax:** _cvar.set\_int(value)_ `value` - Integer value [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### cvar.set\_raw\_int **syntax:** _cvar.set\_raw\_int(value)_ `value` - Integer value This sets the integer value without changing the float and string values. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### cvar.get\_int **syntax:** _cvar.get\_int()_ Returns nil if called on a ConCommand. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### cvar.invoke\_callback **syntax:** _cvar.invoke\_callback()_ For ConCommands, optionally pass extra arguments and they will be forwarded to the callback. For ConVars, optionally pass an extra integer argument specifying the index of the change callback to invoke, otherwise all change callbacks will be invoked. `cvar.snd_setmixer:invoke_callback("Ambient", "vol", "0")` -- equivalent to typing "snd\_setmixer Ambient vol 0" in console [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### database.write **syntax:** _database.write(key, value)_ `key` - Name of the database, must be a string `value` - Value or table Saves a persistent table, possibly overwriting any existing data [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### database.read **syntax:** _database.read(key)_ `key` - Unique string identifier Returns a table [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.get\_local\_player **syntax:** _entity.get\_local\_player()_ Returns the entity index for the local player, or nil on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.get\_all **syntax:** _entity.get\_all(classname)_ `classname` - Optional string that specifies the class name of entities that will be added to the list, for example `"CCSPlayer"`. Returns an array of entity indices. Pass no arguments for all entities. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.get\_players **syntax:** _entity.get\_players(enemies\_only)_ `enemies_only` - Optional. If `true` then you and the players on your team will not be added to the list. Returns an array of player entity indices. Dormant and dead players will not be added to the list. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.get\_game\_rules **syntax:** _entity.get\_game\_rules()_ Returns entity index of CCSGameRulesProxy instance, or nil if none exists. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.get\_player\_resource **syntax:** _entity.get\_player\_resource()_ Returns entity index of CCSPlayerResource instance, or nil if none exists. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.get\_classname **syntax:** _entity.get\_classname(ent)_ `ent` - Entity index. Returns the name of the entity's class, or nil on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.set\_prop **syntax:** _entity.set\_prop(ent, propname, value, array\_index)_ `ent` - Entity index. `propname` - Name of the networked property. `value` - The property will be set to this value. For vectors or angles, separate the components by commas. `array_index` - Optional. If `propname` is an array, the value at this array index will be set. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.get\_prop **syntax:** _entity.get\_prop(ent, propname, array\_index)_ `ent` - Entity index. `propname` - Name of the networked property. `array_index` - Optional. If `propname` is an array, the value at this array index will be returned. Returns the value of the property, or nil on failure. For vectors or angles, this returns three values. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.is\_enemy **syntax:** _entity.is\_enemy(ent)_ `ent` - Entity index. Returns true if the entity is on the other team. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.is\_alive **syntax:** _entity.is\_alive(ent)_ `ent` - Entity index. Returns true if the player is not dead. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.is\_dormant **syntax:** _entity.is\_dormant(ent)_ `ent` - Entity index. Returns true if the player is not dormant. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.get\_player\_name **syntax:** _entity.get\_player\_name(ent)_ `ent` - Player entity index. Returns the player's name, or the string `"unknown"` on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.get\_player\_weapon **syntax:** _entity.get\_player\_weapon(ent)_ `ent` - Player entity index. Returns the entity index of the player's active weapon, or nil if the player is not alive, dormant, etc. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.hitbox\_position **syntax:** _entity.hitbox\_position(player, hitbox)_ `player` - Entity index of the player. `hitbox` - Either a string of the hitbox name, or an integer index of the hitbox. Returns world coordinates `x, y, z`, or nil on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.get\_steam64 **syntax:** _entity.get\_steam64(player)_ `player` - Entity index of the player. Returns steamID3, or nil on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.get\_bounding\_box **syntax:** _entity.get\_bounding\_box(player)_ `player` - Entity index of the player. Returns `x1, y1, x2, y2, alpha_multiplier`. The contents of `x1, y1, x2, y2` must be ignored when `alpha_multiplier` is zero, which indicates that the bounding box is invalid and should not be drawn. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.get\_origin **syntax:** _entity.get\_origin(player)_ `player` - Entity index Returns `x, y, z` world coordinates of the entity's origin, or nil if the entity is dormant and dormant ESP information is not available. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### entity.get\_esp\_data **syntax:** _entity.get\_esp\_data(player)_ `player` - Entity index Returns a table containing `alpha`, `health`, and `weapon_id`, or nil on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### globals.realtime **syntax:** _globals.realtime()_ Returns the local time in seconds. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### globals.curtime **syntax:** _globals.curtime()_ Returns the game time in seconds. This number is synchronized with the server. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### globals.frametime **syntax:** _globals.frametime()_ Returns the number of seconds elapsed during the last game frame. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### globals.absoluteframetime **syntax:** _globals.absoluteframetime()_ Returns the number of seconds elapsed during the last game frame. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### globals.maxplayers **syntax:** _globals.maxplayers()_ Returns the maximum number of players in the server. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### globals.tickcount **syntax:** _globals.tickcount()_ Returns the number of ticks elapsed in the server. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### globals.tickinterval **syntax:** _globals.tickinterval()_ Returns the time elapsed in one game tick in seconds. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### globals.framecount **syntax:** _globals.framecount()_ Returns the number of frames since the game started [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### globals.mapname **syntax:** _globals.mapname()_ Returns the name of the loaded map, or nil if you are not in game. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### globals.lastoutgoingcommand **syntax:** _globals.lastoutgoingcommand()_ Returns the command number of the last outgoing command. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### globals.oldcommandack **syntax:** _globals.oldcommandack()_ Returns the command number of the previous server-acknowledged command. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### globals.commandack **syntax:** _globals.commandack()_ Returns the command number of the most recent server-acknowledged command. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### globals.chokedcommands **syntax:** _globals.chokedcommands()_ Returns the number of choked commands, i.e. the number of commands that haven't yet been sent to the server. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### panorama.open **syntax:** _panorama.open(panel)_ `panel` - Optional panel name [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### panorama.loadstring **syntax:** _panorama.loadstring(js\_code, panel)_ `js_code` - String containing JavaScript code `panel` - Optional panel name [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### materialsystem.get\_name **syntax:** _materialsystem.get\_name()_ Returns name of the material [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### materialsystem.reload **syntax:** _materialsystem.reload()_ Resets the material [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### materialsystem.color\_modulate **syntax:** _materialsystem.color\_modulate(r, g, b)_ `r` - Red (0-255) `g` - Green (0-255) `b` - Blue (0-255) [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### materialsystem.alpha\_modulate **syntax:** _materialsystem.alpha\_modulate(alpha)_ `alpha` - Opacity (0-255) [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### materialsystem.set\_shader\_param **syntax:** _materialsystem.set\_shader\_param(param\_name, value, force)_ `param_name` - Name of the shader parameter `value` - New value `force` - Optional boolean. Add the var if it does not exist in the material [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### materialsystem.get\_shader\_param **syntax:** _materialsystem.get\_shader\_param(param\_name)_ `param_name` - Name of the shader parameter [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### materialsystem.set\_material\_var\_flag **syntax:** _materialsystem.set\_material\_var\_flag(index, enabled)_ `index` - Index of MaterialVarFlags\_t `enabled` - Boolean [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### materialsystem.get\_material\_var\_flag **syntax:** _materialsystem.get\_material\_var\_flag(index)_ `index` - Index of MaterialVarFlags\_t Returns true if the specified flag is set [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### materialsystem.find\_material **syntax:** _materialsystem.find\_material(path, force\_load)_ `path` - Path to material including filename `force_load` - Optional boolean. Load the material if it isn't loaded Returns a reference to the material [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### materialsystem.find\_materials **syntax:** _materialsystem.find\_materials(partial\_path, force\_load)_ `partial_path` - Partial path to material `force_load` - Optional boolean. Load each material if it isn't loaded Returns a table of references to materials that have partial\_path in their name [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### materialsystem.find\_texture **syntax:** _materialsystem.find\_texture(path)_ `path` - Path to texture including filename Returns a reference to the texture that can be used with set\_shader\_param [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### materialsystem.get\_model\_materials **syntax:** _materialsystem.get\_model\_materials(entindex)_ `entindex` - Entity index Returns a table of references to materials used by the entity [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### materialsystem.arms\_material **syntax:** _materialsystem.arms\_material()_ Returns a reference to the arms material when 'Viewmodel arms' is enabled [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### materialsystem.chams\_material **syntax:** _materialsystem.chams\_material()_ Returns a reference to the player chams material [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### plist.set **syntax:** _plist.set(entindex, field, value)_ `entindex` - Player index `field` - Name of the field `value` - Value of the field [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### plist.get **syntax:** _plist.get(entindex, field)_ `entindex` - Player index `field` - Name of the field [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### renderer.text **syntax:** _renderer.text(x, y, r, g, b, a, flags, max\_width, ...)_ `x` - Screen coordinate `y` - Screen coordinate `r` - Red (0-255) `g` - Green (0-255) `b` - Blue (0-255) `a` - Alpha (0-255) `flags` - "+" for large text, "-" for small text, "c" for centered text, "r" for right-aligned text, "b" for bold text, "d" for high DPI support. "c" can be combined with other flags. `nil` can be specified for normal sized uncentered text. `max_width` - Text will be clipped if it exceeds this width in pixels. Use `0` for no limit. `...` - Text that will be drawn This can only be called from the `paint` callback. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### renderer.measure\_text **syntax:** _renderer.measure\_text(flags, ...)_ `flags` - "+" for large text, "-" for small text, or `nil` for normal sized text. `...` - Text that will be measured Returns `width, height`. This can only be called from the `paint` callback. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### renderer.rectangle **syntax:** _renderer.rectangle(x, y, w, h, r, g, b, a)_ `x` - Screen coordinate `y` - Screen coordinate `w` - Width in pixels `h` - Height in pixels `r` - Red (0-255) `g` - Green (0-255) `b` - Blue (0-255) `a` - Alpha (0-255) This can only be called from the `paint` callback. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### renderer.line **syntax:** _renderer.line(xa, ya, xb, yb, r, g, b, a)_ `xa` - Screen coordinate of point A `ya` - Screen coordinate of point A `xb` - Screen coordinate of point B `yb` - Screen coordinate of point B `r` - Red (0-255) `g` - Green (0-255) `b` - Blue (0-255) `a` - Alpha (0-255) This can only be called from the `paint` callback. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### renderer.gradient **syntax:** _renderer.gradient(x, y, w, h, r1, g1, b1, a1, r2, g2, b2, a2, ltr)_ `x` - Screen coordinate `y` - Screen coordinate `w` - Width in pixels `h` - Height in pixels `r1` - Red (0-255) `g1` - Green (0-255) `b1` - Blue (0-255) `a1` - Alpha (0-255) `r2` - Red (0-255) `g2` - Green (0-255) `b2` - Blue (0-255) `a2` - Alpha (0-255) `ltr` - Left to right. Pass `true` for horizontal gradient, or `false` for vertical. This can only be called from the `paint` callback. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### renderer.circle **syntax:** _renderer.circle(x, y, r, g, b, a, radius, start\_degrees, percentage)_ `x` - Screen coordinate `y` - Screen coordinate `r` - Red (0-255) `g` - Green (0-255) `b` - Blue (0-255) `a` - Alpha (0-255) `radius` - Radius of the circle in pixels. `start_degrees` - 0 is the right side, 90 is the bottom, 180 is the left, 270 is the top. `percentage` - Must be within \[0.0-1.0\]. 1.0 is a full circle, 0.5 is a half circle, etc. This can only be called from the `paint` callback. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### renderer.circle\_outline **syntax:** _renderer.circle\_outline(x, y, r, g, b, a, radius, start\_degrees, percentage, thickness)_ `x` - Screen coordinate `y` - Screen coordinate `r` - Red (0-255) `g` - Green (0-255) `b` - Blue (0-255) `a` - Alpha (0-255) `radius` - Radius of the circle in pixels. `start_degrees` - 0 is the right side, 90 is the bottom, 180 is the left, 270 is the top. `percentage` - Must be within \[0.0-1.0\]. 1.0 is a full circle, 0.5 is a half circle, etc. `thickness` - Thickness of the outline in pixels. This can only be called from the `paint` callback. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### renderer.triangle **syntax:** _renderer.triangle(x0, y0, x1, y1, x2, y2, r, g, b, a)_ `x0` - Screen coordinate X for point A `y0` - Screen coordinate Y for point A `x1` - Screen coordinate X for point B `y1` - Screen coordinate Y for point B `x2` - Screen coordinate X for point C `y2` - Screen coordinate Y for point C `r` - Red (0-255) `g` - Green (0-255) `b` - Blue (0-255) `a` - Alpha (0-255) This can only be called from the `paint` callback. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### renderer.world\_to\_screen **syntax:** _renderer.world\_to\_screen(x, y, z)_ `x` - Position in world space `y` - Position in world space `z` - Position in world space Returns two screen coordinates (x, y), or `nil` if the world position is not visible on your screen. This can only be called from the `paint` callback. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### renderer.indicator **syntax:** _renderer.indicator(r, g, b, a, ...)_ `r` - Red (0-255) `g` - Green (0-255) `b` - Blue (0-255) `a` - Alpha (0-255) `...` - The text that will be drawn Returns the Y screen coordinate (vertical offset) of the drawn text, or nil on failure. This can only be called from the `paint` callback. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### renderer.texture **syntax:** _renderer.texture(id, x, y, w, h, r, g, b, a, mode)_ `id` - Texture ID `x` - X screen coordinate `y` - Y screen coordinate `w` - Width `h` - Height `r` - Red (0-255) `g` - Green (0-255) `b` - Blue (0-255) `a` - Alpha (1-255) `mode` - Optional string: "f" for fill, "r" for repeat, otherwise automatic In fill mode, the texture will be stretched to the specified size. This may cause textures to appear blurry if the specified size is not the same as the texture's size. In repeat mode, the texture will be tiled. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### renderer.load\_svg **syntax:** _renderer.load\_svg(contents, width, height)_ `contents` - SVG file contents `width` - Width `height` - Height Returns a texture ID that can be used with renderer.texture, or nil on failure [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### renderer.load\_png **syntax:** _renderer.load\_png(contents, width, height)_ `contents` - PNG file contents `width` - Width `height` - Height Returns a texture ID that can be used with renderer.texture, or nil on failure [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### renderer.load\_jpg **syntax:** _renderer.load\_jpg(contents, width, height)_ `contents` - JPG file contents `width` - Width `height` - Height Returns a texture ID that can be used with renderer.texture, or nil on failure [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### renderer.load\_rgba **syntax:** _renderer.load\_rgba(contents, width, height)_ `contents` - RGBA buffer `width` - Width `height` - Height Returns a texture ID that can be used with renderer.texture, or nil on failure [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.new\_checkbox **syntax:** _ui.new\_checkbox(tab, container, name)_ `tab` - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA. `container` - The name of the existing container to which this control will be added. `name` - The name of the checkbox. Returns a special value that can be passed to `ui.get` and `ui.set`, or throws an error on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.new\_slider **syntax:** _ui.new\_slider(tab, container, name, min, max, init\_value, show\_tooltip, unit, scale, tooltips)_ `tab` - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA. `container` - The name of the existing container to which this control will be added. `name` - The name of the slider. `min` - The minimum value that can be set using the slider. `max` - The maximum value that can be set using the slider. `init_value` - Optional integer. The initial value. If not provided, the initial value will be `min`. `show_tooltip` - Optional boolean. `true` if the slider should display its current value. `unit` - Optional string that is two characters or less. This will be appended to the display value. For example, "`px`" for pixels or "`%`" for a percentage. `scale` - Optional The display value will be multiplied by this scale. For example, 0.1 will make a slider with the range \[0-1800\] show as 0.0-180.0 with one decimal place. `tooltips` - Optional table used to override the tooltip for the specified values. The key must be within `min`\-`max`. The value is a string that will be shown instead of the numeric value whenever that value is selected. Returns a special value that can be passed to `ui.get` and `ui.set`, or throws an error on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.new\_combobox **syntax:** _ui.new\_combobox(tab, container, name, ...)_ `tab` - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA. `container` - The name of the existing container to which this control will be added. `name` - The name of the combobox. `...` - One or more comma separated string values that will be added to the combobox. Alternatively, a table of strings that will be added. Returns a special value that can be passed to `ui.get` and `ui.set`, or throws an error on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.new\_multiselect **syntax:** _ui.new\_multiselect(tab, container, name, ...)_ `tab` - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA. `container` - The name of the existing container to which this control will be added. `name` - The name of the multiselect. `...` - One or more comma separated string values that will be added to the combobox. Alternatively, a table of strings that will be added. Returns a special value that can be passed to `ui.get` and `ui.set`, or throws an error on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.new\_hotkey **syntax:** _ui.new\_hotkey(tab, container, name, inline, default\_hotkey)_ `tab` - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA. `container` - The name of the existing container to which this control will be added. `name` - The name of the hotkey. `inline` - Optional boolean. If set to true, the hotkey will be placed to the right of the preceding menu item. `default_hotkey` - Optional virtual key Returns a special value that can be passed to `ui.get` to see if the hotkey is pressed, or throws an error on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.new\_button **syntax:** _ui.new\_button(tab, container, name, callback)_ `tab` - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA. `container` - The name of the existing container to which this checkbox will be added. `name` - The name of the button. `callback` - The lua function that will be called when the button is pressed. Throws an error on failure. The return value should not be used with `ui.set` or `ui.get`. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.new\_color\_picker **syntax:** _ui.new\_color\_picker(tab, container, name, r, g, b, a)_ `tab` - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA. `container` - The name of the existing container to which this checkbox will be added. `name` - The name of the color picker. This will not be shown, it is only used to identify this item in saved configs. `r` - Optional initial red value (0-255) `g` - Optional initial green value (0-255) `b` - Optional initial blue value (0-255) `a` - Optional initial alpha value (0-255) Throws an error on failure. The color picker is placed to the right of the previous menu item. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.new\_textbox **syntax:** _ui.new\_textbox(tab, container, name)_ `tab` - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA. `container` - The name of the existing container to which this textbox will be added. `name` - The name of the textbox Throws an error on failure. Returns a special value that can be used with ui.get [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.new\_listbox **syntax:** _ui.new\_listbox(tab, container, name, items)_ `tab` - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA `container` - The name of the existing container to which this listbox will be added `name` - Name `items` - Optional table of items (strings) Throws an error on failure. Returns a special value that can be used with ui.get. Calling ui.get on a listbox will return the zero-based index of the currently selected string. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.new\_string **syntax:** _ui.new\_string(name, value)_ `name` - Name `value` - Optional string that specifies the default value. Returns a special value that can be used with `ui.get` and `ui.set`. This function does not create any menu items. The value will be stored in configs just like other menu items. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.new\_label **syntax:** _ui.new\_label(tab, container, name)_ `tab` - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA `container` - The name of the existing container to which this listbox will be added `name` - Name Returns a special value that can be used with `ui.set` [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.reference **syntax:** _ui.reference(tab, container, name)_ `tab` - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA. `container` - The name of the existing container to which this checkbox will be added. `name` - The name of the menu item. Avoid calling this from inside a function. Returns a reference that can be passed to `ui.get` and `ui.set`, or throws an error on failure. This allows you to access a built-in pre-existing menu items. This function returns multiple values when the specified menu item is followed by unnamed menu items, for example a color picker or a hotkey. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.set **syntax:** _ui.set(item, value, ...)_ `item` - The result of either `ui.new_*` or `ui.reference` `value` - The value to which the menu item will be set `...` - Optional. For multiselect comboboxes, you may want to set more than one option. For checkboxes, pass `true` or `false`. For a slider, pass a number that is within the slider's minimum/maximum values. For a combobox, pass a string value. For a multiselect combobox, pass zero or more strings. For referenced buttons, `value` is ignored and the button's callback is invoked. For color pickers, pass the arguments `r, g, b, a`. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.get **syntax:** _ui.get(item)_ `item` - The special value returned by `ui.new_checkbox`, `ui.new_slider`, `ui.new_combobox`, `ui.new_hotkey`, or `ui.reference`. For a checkbox, returns `true` or `false`. For a slider, returns an integer. For a combobox, returns a string. For a multiselect combobox, returns an array of strings. For a hotkey, returns `true` if the hotkey is active. For a color picker, returns `r, g, b, a`. Throws an error on failure. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.set\_callback **syntax:** _ui.set\_callback(item, callback)_ `item` - The special value returned by `ui.new_*`. Do not try passing a reference to an existing menu item. `callback` - Lua function that will be called when the menu item changes values. For example, this will be called when the user checks or unchecks a checkbox. `item` is passed as an argument to the callback function. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.set\_visible **syntax:** _ui.set\_visible(item, visible)_ `item` - A menu item reference. `visible` - Boolean. Pass `false` to hide the control from the menu. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.is\_menu\_open **syntax:** _ui.is\_menu\_open()_ Returns `true` if the menu is currently open. [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.mouse\_position **syntax:** _ui.mouse\_position()_ Returns current mouse coordinates `x, y` [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.menu\_position **syntax:** _ui.menu\_position()_ Returns current window coordinates `x, y` [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.menu\_size **syntax:** _ui.menu\_size()_ Returns current menu size `width, height` [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ### ui.name **syntax:** _ui.name(item)_ `item` - Reference to menu item Returns the display name [Back to TOC](https://hrisitosense.github.io/lua#gamesenseapiforlua) ---