### Material System Example Source: https://github.com/gamesensical/docs/blob/master/build/gitbook/globals/materialsystem.md A basic example demonstrating the usage of the materialsystem functions in Lua. ```lua -- materialsystem example here ``` -------------------------------- ### Example Usage Source: https://github.com/gamesensical/docs/blob/master/build/mkdocs/docs/globals/materialsystem.md A basic example demonstrating the usage of the materialsystem module in Lua. ```lua -- materialsystem example here ``` -------------------------------- ### Lua Database Example Source: https://github.com/gamesensical/docs/blob/master/build/mkdocs/docs/globals/database.md Example demonstrating how to use the database functions to read initial data, update a counter, log kills, and save data on script shutdown. ```lua local data = database.read("example-1") or {} data.load_count = (data.load_count or 0) + 1 client.log("this is the ", data.load_count, ". time you've loaded this script!") client.set_event_callback("player_death", function(e) if client.userid_to_entindex(e.attacker) == entity.get_local_player() then data.kill_count = (data.kill_count or 0) + 1 client.log("this is your ", data.kill_count, ". kill!") end end) client.set_event_callback("shutdown", function() database.write("example-1", data) end) ``` -------------------------------- ### Database Usage Example Source: https://github.com/gamesensical/docs/blob/master/build/gitbook/globals/database.md An example demonstrating how to use the database module to store and retrieve data, including logging script load counts and kill counts, and saving data on script shutdown. ```lua local data = database.read("example-1") or {} data.load_count = (data.load_count or 0) + 1 client.log("this is the ", data.load_count, ". time you've loaded this script!") client.set_event_callback("player_death", function(e) if client.userid_to_entindex(e.attacker) == entity.get_local_player() then data.kill_count = (data.kill_count or 0) + 1 client.log("this is your ", data.kill_count, ". kill!") end end) client.set_event_callback("shutdown", function() database.write("example-1", data) end) ``` -------------------------------- ### Lua Scripting Examples Source: https://github.com/gamesensical/docs/blob/master/build/gitbook/SUMMARY.md Examples of Lua scripts for various functionalities within Gamesensical, such as creating interfaces, implementing game logic, and handling events. ```lua -- Simple watermark example --[[ ... code for watermark ... ]] ``` ```lua -- Head Dot ESP example --[[ ... code for head dot ESP ... ]] ``` ```lua -- Talk shit example --[[ ... code for talk shit ... ]] ``` ```lua -- Auto buy on round start example --[[ ... code for auto buy ... ]] ``` ```lua -- Create Interface example --[[ ... code for create interface ... ]] ``` -------------------------------- ### Lua: Accessing InputSystem with create_interface Source: https://github.com/gamesensical/docs/blob/master/build/gitbook/development/examples/create_interface.md This Lua script demonstrates how to use `client.create_interface` to get a pointer to the `InputSystem` from 'inputsystem.dll'. It then uses FFI to cast the pointer, access the virtual method table (vtable), locate the `IsButtonDown` function, and cast it to a callable function. The example shows how to check if the 'Z' key is pressed. ```lua local ffi = require 'ffi' ffi.cdef [[ typedef unsigned char wchar_t; typedef bool (__thiscall *IsButtonDown_t)(void*, int); ]] local interface_ptr = ffi.typeof('void***') local raw_inputsystem = client.create_interface('inputsystem.dll', 'InputSystemVersion001') -- cast the lightuserdata to a type that we can dereference local inputsystem = ffi.cast(interface_ptr, raw_inputsystem) -- void*** -- dereference the interface pointer to get its vtable local inputsystem_vtbl = inputsystem[0] -- void** -- vtable is an array of functions, the 15th is IsButtonDown local raw_IsButtonDown = inputsystem_vtbl[15] -- void* -- cast the function pointer to a callable type local is_button_pressed = ffi.cast('IsButtonDown_t', raw_IsButtonDown) local function run_command(cmd) if is_button_pressed(inputsystem, 36) then -- ButtonCode_t for Z print('Z is pressed') end return false end client.set_event_callback('run_command', run_command) ``` -------------------------------- ### Lua Scripting Examples Source: https://github.com/gamesensical/docs/blob/master/src/mkdocs/docs/SUMMARY.md A collection of example Lua scripts demonstrating various functionalities within Gamesensical, such as creating interfaces, implementing game logic, and handling events. ```lua -- Simple watermark example -- Add a watermark to the screen -- Head Dot ESP example -- Display a dot above the enemy's head -- Talk shit example -- Send chat messages -- Auto buy on round start -- Automatically purchase items at the start of a round -- Create Interface example -- Create custom UI elements ``` -------------------------------- ### GameSense Lua API Snippets Installation Source: https://github.com/gamesensical/docs/blob/master/src/mkdocs/docs/development/editors/vscode.md Instructions for installing the GameSense Lua API Snippets extension for VSCode and Atom. This extension provides descriptions for most API functions and arguments, keeping them up-to-date with the current API. ```markdown 1. Go to the [VSCode Marketplace page of the GameSense Lua API Snippets](https://marketplace.visualstudio.com/items?itemName=Nexxed.gamesense-lua) and click the green install button. 2. Follow the instructions. 3. Profit! ``` -------------------------------- ### Lua: Accessing InputSystem with create_interface Source: https://github.com/gamesensical/docs/blob/master/src/mkdocs/docs/development/examples/create_interface.md This Lua script demonstrates how to use `client.create_interface` to get a pointer to the `InputSystem` from 'inputsystem.dll'. It then uses FFI to cast the pointer, access the virtual method table (vtable), locate the `IsButtonDown` function, and cast it to a callable function. The example shows how to check if the 'Z' key is pressed. ```lua local ffi = require 'ffi' ffi.cdef [[ typedef unsigned char wchar_t; typedef bool (__thiscall *IsButtonDown_t)(void*, int); ]] local interface_ptr = ffi.typeof('void***') local raw_inputsystem = client.create_interface('inputsystem.dll', 'InputSystemVersion001') -- cast the lightuserdata to a type that we can dereference local inputsystem = ffi.cast(interface_ptr, raw_inputsystem) -- void*** -- dereference the interface pointer to get its vtable local inputsystem_vtbl = inputsystem[0] -- void** -- vtable is an array of functions, the 15th is IsButtonDown local raw_IsButtonDown = inputsystem_vtbl[15] -- void* -- cast the function pointer to a callable type local is_button_pressed = ffi.cast('IsButtonDown_t', raw_IsButtonDown) local function run_command(cmd) if is_button_pressed(inputsystem, 36) then -- ButtonCode_t for Z print('Z is pressed') end return false end client.set_event_callback('run_command', run_command) ``` -------------------------------- ### Lua: Accessing InputSystem with create_interface Source: https://github.com/gamesensical/docs/blob/master/src/gitbook/development/examples/create_interface.md This Lua script demonstrates how to use `client.create_interface` to get a pointer to the `InputSystem` from 'inputsystem.dll'. It then uses FFI to cast the pointer, access the virtual method table (vtable), locate the `IsButtonDown` function, and cast it to a callable function. The example shows how to check if the 'Z' key is pressed. ```lua local ffi = require 'ffi' ffi.cdef [[ typedef unsigned char wchar_t; typedef bool (__thiscall *IsButtonDown_t)(void*, int); ]] local interface_ptr = ffi.typeof('void***') local raw_inputsystem = client.create_interface('inputsystem.dll', 'InputSystemVersion001') -- cast the lightuserdata to a type that we can dereference local inputsystem = ffi.cast(interface_ptr, raw_inputsystem) -- void*** -- dereference the interface pointer to get its vtable local inputsystem_vtbl = inputsystem[0] -- void** -- vtable is an array of functions, the 15th is IsButtonDown local raw_IsButtonDown = inputsystem_vtbl[15] -- void* -- cast the function pointer to a callable type local is_button_pressed = ffi.cast('IsButtonDown_t', raw_IsButtonDown) local function run_command(cmd) if is_button_pressed(inputsystem, 36) then -- ButtonCode_t for Z print('Z is pressed') end return false end client.set_event_callback('run_command', run_command) ``` -------------------------------- ### Vector Library Initialization Source: https://github.com/gamesensical/docs/blob/master/build/mkdocs/docs/globals/vector.md Demonstrates how to load and use the built-in vector library. Requires the 'vector' library to be loaded before use. ```lua require "vector" -- Example usage: local myVector = vector(1, 2, 3) print(myVector.x, myVector.y, myVector.z) ``` -------------------------------- ### Lua: Accessing InputSystem with create_interface Source: https://github.com/gamesensical/docs/blob/master/build/mkdocs/docs/development/examples/create_interface.md This Lua script demonstrates how to use `client.create_interface` to get a pointer to the `InputSystem` from 'inputsystem.dll'. It then uses FFI to cast the pointer, access the virtual method table (vtable), locate the `IsButtonDown` function, and cast it to a callable function. The example shows how to check if the 'Z' key is pressed. ```lua local ffi = require 'ffi' ffi.cdef [[ typedef unsigned char wchar_t; typedef bool (__thiscall *IsButtonDown_t)(void*, int); ]] local interface_ptr = ffi.typeof('void***') local raw_inputsystem = client.create_interface('inputsystem.dll', 'InputSystemVersion001') -- cast the lightuserdata to a type that we can dereference local inputsystem = ffi.cast(interface_ptr, raw_inputsystem) -- void*** -- dereference the interface pointer to get its vtable local inputsystem_vtbl = inputsystem[0] -- void** -- vtable is an array of functions, the 15th is IsButtonDown local raw_IsButtonDown = inputsystem_vtbl[15] -- void* -- cast the function pointer to a callable type local is_button_pressed = ffi.cast('IsButtonDown_t', raw_IsButtonDown) local function run_command(cmd) if is_button_pressed(inputsystem, 36) then -- ButtonCode_t for Z print('Z is pressed') end return false end client.set_event_callback('run_command', run_command) ``` -------------------------------- ### Lua Script Installation Source: https://github.com/gamesensical/docs/blob/master/build/gitbook/usage/using_lua_scripts.md Instructions for saving and loading Lua scripts within the CS:GO environment. Ensure scripts have a .lua extension and are placed in the correct directory. Use the 'Lua script manager' to load scripts and optionally set them to load on startup. ```text 1. Save the Lua script in the same folder as csgo.exe. The file extension should be ".lua". 2. Go to the "MISC" tab and click the "Lua script manager" button. 3. Select the script you want to load and click "Load script". 4. Tick "Load on startup" to automatically load the script when the cheat loads. ``` -------------------------------- ### Lua Script Installation Source: https://github.com/gamesensical/docs/blob/master/src/gitbook/usage/using_lua_scripts.md Instructions for saving and loading Lua scripts within the CS:GO environment. Ensure scripts have a .lua extension and are placed in the correct directory. Use the 'Lua script manager' to load scripts and optionally set them to load on startup. ```text 1. Save the Lua script in the same folder as csgo.exe. The file extension should be ".lua". 2. Go to the "MISC" tab and click the "Lua script manager" button. 3. Select the script you want to load and click "Load script". 4. Tick "Load on startup" to automatically load the script when the cheat loads. ``` -------------------------------- ### Item References Source: https://github.com/gamesensical/docs/blob/master/build/gitbook/netprops/items.md This section provides references to individual item documentation pages. Each reference is a link to a separate markdown file detailing a specific item. ```markdown {% page-ref page="CAK47.md" %} {% page-ref page="CBaseCSGrenade.md" %} {% page-ref page="CBaseGrenade.md" %} {% page-ref page="CBreachCharge.md" %} {% page-ref page="CBumpMine.md" %} {% page-ref page="CC4.md" %} {% page-ref page="CDEagle.md" %} {% page-ref page="CDecoyGrenade.md" %} {% page-ref page="CEconEntity.md" %} {% page-ref page="CFists.md" %} {% page-ref page="CFlashbang.md" %} {% page-ref page="CHEGrenade.md" %} {% page-ref page="CIncendiaryGrenade.md" %} {% page-ref page="CItem_Healthshot.md" %} {% page-ref page="CItemCash.md" %} {% page-ref page="CItemDogtags.md" %} {% page-ref page="CKnife.md" %} {% page-ref page="CKnifeGG.md" %} {% page-ref page="CMelee.md" %} {% page-ref page="CMolotovGrenade.md" %} {% page-ref page="CSCAR17.md" %} {% page-ref page="CSensorGrenade.md" %} {% page-ref page="CSmokeGrenade.md" %} {% page-ref page="CSnowball.md" %} {% page-ref page="CTablet.md" %} {% page-ref page="CWeaponAug.md" %} {% page-ref page="CWeaponAWP.md" %} {% page-ref page="CWeaponBaseItem.md" %} {% page-ref page="CWeaponBizon.md" %} {% page-ref page="CWeaponCSBase.md" %} {% page-ref page="CWeaponCSBaseGun.md" %} {% page-ref page="CWeaponCycler.md" %} {% page-ref page="CWeaponElite.md" %} {% page-ref page="CWeaponFamas.md" %} {% page-ref page="CWeaponFiveSeven.md" %} {% page-ref page="CWeaponG3SG1.md" %} {% page-ref page="CWeaponGalil.md" %} {% page-ref page="CWeaponGalilAR.md" %} {% page-ref page="CWeaponGlock.md" %} {% page-ref page="CWeaponHKP2000.md" %} {% page-ref page="CWeaponM249.md" %} {% page-ref page="CWeaponM3.md" %} {% page-ref page="CWeaponM4A1.md" %} {% page-ref page="CWeaponMAC10.md" %} {% page-ref page="CWeaponMag7.md" %} {% page-ref page="CWeaponMP5Navy.md" %} {% page-ref page="CWeaponMP7.md" %} {% page-ref page="CWeaponMP9.md" %} {% page-ref page="CWeaponNegev.md" %} {% page-ref page="CWeaponNOVA.md" %} {% page-ref page="CWeaponP228.md" %} {% page-ref page="CWeaponP250.md" %} {% page-ref page="CWeaponP90.md" %} {% page-ref page="CWeaponSawedoff.md" %} {% page-ref page="CWeaponSCAR20.md" %} {% page-ref page="CWeaponScout.md" %} {% page-ref page="CWeaponSG550.md" %} {% page-ref page="CWeaponSG552.md" %} {% page-ref page="CWeaponSG556.md" %} {% page-ref page="CWeaponShield.md" %} {% page-ref page="CWeaponSSG08.md" %} {% page-ref page="CWeaponTaser.md" %} {% page-ref page="CWeaponTec9.md" %} {% page-ref page="CWeaponTMP.md" %} {% page-ref page="CWeaponUMP45.md" %} {% page-ref page="CWeaponUSP.md" %} {% page-ref page="CWeaponXM1014.md" %} {% page-ref page="CWeaponZoneRepulsor.md" %} {% page-ref page="ParticleSmokeGrenade.md" %} ``` -------------------------------- ### Get Entity Bounding Box Source: https://github.com/gamesensical/docs/blob/master/build/mkdocs/docs/globals/entity.md Gets the bounding box coordinates and alpha multiplier for a given player entity. The coordinates are ignored if the alpha multiplier is zero. ```lua entity.get_bounding_box(player: number): number, number, number, number, number --[[ Argument: player (number, entindex) - 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. ]] ``` -------------------------------- ### Lua Script Installation Source: https://github.com/gamesensical/docs/blob/master/src/mkdocs/docs/usage/using_lua_scripts.md Instructions for saving and loading Lua scripts within the CS:GO environment. Ensure scripts have a .lua extension and are placed in the correct directory. Use the 'Lua script manager' to load scripts and optionally set them to load on startup. ```text 1. Save the Lua script in the same folder as csgo.exe. The file extension should be ".lua". 2. Go to the "MISC" tab and click the "Lua script manager" button. 3. Select the script you want to load and click "Load script". 4. Tick "Load on startup" to automatically load the script when the cheat loads. ``` -------------------------------- ### Player Netprops Source: https://github.com/gamesensical/docs/blob/master/build/gitbook/SUMMARY.md Documentation for CBasePlayer netprops, detailing player-specific properties and functionalities. ```markdown * [CBasePlayer](netprops/CBasePlayer.md) * [CBasePropDoor](netprops/CBasePropDoor.md) * [CBaseTeamObjectiveResource](netprops/CBaseTeamObjectiveResource.md) * [CBaseTempEntity](netprops/CBaseTempEntity.md) * [CBaseToggle](netprops/CBaseToggle.md) * [CBaseTrigger](netprops/CBaseTrigger.md) * [CBaseViewModel](netprops/CBaseViewModel.md) * [CBaseVPhysicsTrigger](netprops/CBaseVPhysicsTrigger.md) * [CBaseWeaponWorldModel](netprops/CBaseWeaponWorldModel.md) ``` -------------------------------- ### GameSense Lua API Snippets Installation Source: https://github.com/gamesensical/docs/blob/master/src/gitbook/development/editors/vscode.md Instructions for installing the GameSense Lua API Snippets extension for VSCode and Atom. This extension provides descriptions for most API functions and arguments, keeping them up-to-date with the current API. ```markdown 1. Go to the [VSCode Marketplace page of the GameSense Lua API Snippets](https://marketplace.visualstudio.com/items?itemName=Nexxed.gamesense-lua) and click the green install button. 2. Follow the instructions. 3. Profit! ``` -------------------------------- ### Lua Script Installation Source: https://github.com/gamesensical/docs/blob/master/build/mkdocs/docs/usage/using_lua_scripts.md Instructions for saving and loading Lua scripts within the CS:GO environment. Ensure scripts have a .lua extension and are placed in the correct directory. Use the 'Lua script manager' to load scripts and optionally set them to load on startup. ```text 1. Save the Lua script in the same folder as csgo.exe. The file extension should be ".lua". 2. Go to the "MISC" tab and click the "Lua script manager" button. 3. Select the script you want to load and click "Load script". 4. Tick "Load on startup" to automatically load the script when the cheat loads. ```