# Table of Contents - [Overview | Lua API](#overview-lua-api) - [Creating scripts | Lua API](#creating-scripts-lua-api) - [Metadata | Lua API](#metadata-lua-api) - [Examples | Lua API](#examples-lua-api) - [Engine | Lua API](#engine-lua-api) - [Useful resources | Lua API](#useful-resources-lua-api) - [Callbacks | Lua API](#callbacks-lua-api) - [Namespaces | Lua API](#namespaces-lua-api) - [Math | Lua API](#math-lua-api) - [Entities | Lua API](#entities-lua-api) - [Panorama | Lua API](#panorama-lua-api) - [Input | Lua API](#input-lua-api) - [Database | Lua API](#database-lua-api) - [Global Vars | Lua API](#global-vars-lua-api) - [Fatality | Lua API](#fatality-lua-api) - [Instances | Lua API](#instances-lua-api) - [Server | Lua API](#server-lua-api) - [Gamerules | Lua API](#gamerules-lua-api) - [Materials | Lua API](#materials-lua-api) - [Gui | Lua API](#gui-lua-api) - [Zip | Lua API](#zip-lua-api) - [Filesystem | Lua API](#filesystem-lua-api) - [Datatypes | Lua API](#datatypes-lua-api) - [combobox | Lua API](#combobox-lua-api) - [checkbox | Lua API](#checkbox-lua-api) - [textbox | Lua API](#textbox-lua-api) - [player_info | Lua API](#player-info-lua-api) - [control | Lua API](#control-lua-api) - [timer | Lua API](#timer-lua-api) - [slider | Lua API](#slider-lua-api) - [weapon_info | Lua API](#weapon-info-lua-api) - [color_picker | Lua API](#color-picker-lua-api) - [list | Lua API](#list-lua-api) - [trace_t | Lua API](#trace-t-lua-api) - [cvar | Lua API](#cvar-lua-api) - [user_cmd | Lua API](#user-cmd-lua-api) - [animator | Lua API](#animator-lua-api) - [shot_info | Lua API](#shot-info-lua-api) - [material_var | Lua API](#material-var-lua-api) - [game_event | Lua API](#game-event-lua-api) - [vec3 | Lua API](#vec3-lua-api) - [zip | Lua API](#zip-lua-api) - [material | Lua API](#material-lua-api) - [entity | Lua API](#entity-lua-api) - [Render | Lua API](#render-lua-api) - [Utilities | Lua API](#utilities-lua-api) - [Namespaces | Lua API](#namespaces-lua-api) --- # Overview | Lua API [hashtag](https://golua.fatality.win/#official-lua-api-documentation-for-fatality.win) Official lua API documentation for [fatality.winarrow-up-right](https://fatality.win/) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [NextCreating scriptschevron-right](https://golua.fatality.win/getting-started/creating-scripts) Last updated 1 year ago --- # Creating scripts | Lua API ### [hashtag](https://golua.fatality.win/getting-started/creating-scripts#script-directory) Script directory (The drive csgo is installed on):\\Program Files (x86)\\(Steam folder name)\\steamapps\\common\\Counter-Strike Global Offensive\\fatality\\scripts ### [hashtag](https://golua.fatality.win/getting-started/creating-scripts#creating-a-script-in-vscode) Creating a script in VSCode 1. Select "File" in the top left of the application 2. Select "New File" 3. Enter your script's name followed by ".lua" 4. You will be prompted with the file explorer. Place your script in the [script directory.](https://golua.fatality.win/getting-started/creating-scripts#script-directory) ### [hashtag](https://golua.fatality.win/getting-started/creating-scripts#ide) IDE * [Visual Studio Codearrow-up-right](https://code.visualstudio.com/) * [Atomarrow-up-right](https://atom.io/) * [Sublime textarrow-up-right](https://www.sublimetext.com/download) file-download 30KB [fatal.code-snippets](https://3509372639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FafgbISA4aNSPwgb4N4AD%2Fuploads%2Fokh4orZoewcjZ0QmqcKo%2Ffatal.code-snippets?alt=media&token=ef3988c2-062d-4cf6-be86-816f38d1ad43) downloadDownload[arrow-up-right-from-squareOpen](https://3509372639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FafgbISA4aNSPwgb4N4AD%2Fuploads%2Fokh4orZoewcjZ0QmqcKo%2Ffatal.code-snippets?alt=media&token=ef3988c2-062d-4cf6-be86-816f38d1ad43) Visual studio code snippets ### [hashtag](https://golua.fatality.win/getting-started/creating-scripts#support) Support Join the [support discordarrow-up-right](https://discord.gg/gBZneu82zT) for any questions. [PreviousOverviewchevron-left](https://golua.fatality.win/) [NextMetadatachevron-right](https://golua.fatality.win/getting-started/metadata) Last updated 3 years ago --- # Metadata | Lua API [hashtag](https://golua.fatality.win/getting-started/metadata#workshop-info) Workshop info ----------------------------------------------------------------------------------------------- Use `--.name The name of your script here` to set the script's name. Use `--.description Your custom description` to set the script's description. Use `--.author Your name here` to set the author title. [hashtag](https://golua.fatality.win/getting-started/metadata#example) Example ----------------------------------------------------------------------------------- Copy --.name Console Input Reader --.description Read console input through the console callback --.author Jewls function on_console_input(input) print(string.format("You have just entered: %s", input) end [PreviousCreating scriptschevron-left](https://golua.fatality.win/getting-started/creating-scripts) [NextCallbackschevron-right](https://golua.fatality.win/getting-started/callbacks) Last updated 3 years ago --- # Examples | Lua API [hashtag](https://golua.fatality.win/getting-started/examples#examples) Examples: -------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/getting-started/examples#calling-virtual-functions) Calling virtual functions Copy -- Get the interface address local IVEngineClient = utils.find_interface("engine.dll", "VEngineClient014") or error("Engine client is invalid") -- Cast to a pointer that can be dereferenced local IVEngineClientPtr = ffi.cast("void***", IVEngineClient) -- Dereference to get the vtable local IVEngineClientVtable = IVEngineClientPtr[0] -- Get virtual function ptr local ClientCmdPtr = IVEngineClientVtable[108] -- Cast the address to the function type local ClientCmd = ffi.cast(ffi.typeof("void(__thiscall*)(void*, const char*)"), ClientCmdPtr) -- Call the virtual function with the interface ptr as the first argument ClientCmd(IVEngineClientPtr, "say Hello from lua-ffi") ------------------------------------------------- -- All of this can be compacted into one function ------------------------------------------------- local function vtable_bind(interface, type, index) local this = ffi.cast("void***", interface) return function (...) return ffi.cast(ffi.typeof(type), this[0][index])(this, ...) end end -- Interface Function type Virtual index local ClientCmd_AltVersion = vtable_bind(IVEngineClient, "void(__thiscall*)(void*, const char*)", 108) ### [hashtag](https://golua.fatality.win/getting-started/examples#watermark) Watermark Copy -- Create a gui element local CheckboxItem = gui.add_checkbox("Example Watermark", "Visuals>Misc>Various") -- Get our font local Font = render.create_font("verdana.ttf", 14) -- Set how many pixels of spacing we want local Spacing = {30, 30} local Padding = {6, 2} local WatermarkName = "Fatality.win" -- Use the paint callback function on_paint() -- Check if our checkbox is active (get_bool() == true) -- If not then do nothing and return if not CheckboxItem:get_bool() then return end -- Get our screensize local ScreenSize = {render.get_screen_size()} -- Calculate the text size of the cheat name local TextSize = {render.get_text_size(Font, WatermarkName)} -- Calculate our text size with spacing local Size = {TextSize[1] + (Padding[1] * 2), TextSize[2] + (Padding[2] * 2)} local Position = {ScreenSize[1] - Size[1] - Spacing[1], Spacing[2]} -- Render background render.rect_filled(Position[1], Position[2], Position[1] + Size[1], Position[2] + Size[2], render.color(58, 36, 107, 255)) render.rect(Position[1], Position[2], Position[1] + Size[1], Position[2] + Size[2], render.color(26, 22, 64, 200)) -- Render our text render.text(Font, Position[1] + Padding[1], Position[2] + Size[2] / 2, WatermarkName, render.color("#FFFFFF"), render.align_left, render.align_center) end ### [hashtag](https://golua.fatality.win/getting-started/examples#accessing-callbacks) Accessing callbacks Copy -- define a function with the name of the callback you want to use -- here i will use create_move -- add any parameters that are passed into the callback (read the callbacks page to see what is passed in each callback) -- for example events from their callbacks are accessed like this function on_item_pickup(event <- here) function on_create_move(user_cmd) -- here you can access the data inside of the current user command (user_cmd datatype) user_cmd:get_buttons() end [PreviousCallbackschevron-left](https://golua.fatality.win/getting-started/callbacks) [NextUseful resourceschevron-right](https://golua.fatality.win/getting-started/useful-resources) Last updated 2 years ago --- # Engine | Lua API [hashtag](https://golua.fatality.win/documentation/namespaces/engine#functions) Functions ---------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/engine#get_local_player) get\_local\_player Copy engine.get_local_player() #### [hashtag](https://golua.fatality.win/documentation/namespaces/engine#returns) Returns: [Value](https://golua.fatality.win/documentation/namespaces/engine) [Datatype](https://golua.fatality.win/documentation/namespaces/engine) local player's entity index number ### [hashtag](https://golua.fatality.win/documentation/namespaces/engine#get_player_for_user_id) get\_player\_for\_user\_id Copy engine.get_player_for_user_id(event:get_int("userid")) [Parameter](https://golua.fatality.win/documentation/namespaces/engine) [Datatype](https://golua.fatality.win/documentation/namespaces/engine) [Description](https://golua.fatality.win/documentation/namespaces/engine) player's [user\_idarrow-up-right](https://developer.valvesoftware.com/wiki/Userid) number players user\_id. can be retrieved with their [player\_info](https://golua.fatality.win/documentation/datatypes/player_info) or an event #### [hashtag](https://golua.fatality.win/documentation/namespaces/engine#returns-1) Returns: [Value](https://golua.fatality.win/documentation/namespaces/engine) [Datatype](https://golua.fatality.win/documentation/namespaces/engine) player's entity index number ### [hashtag](https://golua.fatality.win/documentation/namespaces/engine#get_player_info) get\_player\_info Copy engine.get_player_info(engine.get_local_player()) [Parameter](https://golua.fatality.win/documentation/namespaces/engine) [Datatype](https://golua.fatality.win/documentation/namespaces/engine) [Description](https://golua.fatality.win/documentation/namespaces/engine) player's entity index number players entity index (1 - 64) #### [hashtag](https://golua.fatality.win/documentation/namespaces/engine#returns-2) Returns: [Value](https://golua.fatality.win/documentation/namespaces/engine) [Datatype](https://golua.fatality.win/documentation/namespaces/engine) player's info [player\_info](https://golua.fatality.win/documentation/datatypes/player_info) ### [hashtag](https://golua.fatality.win/documentation/namespaces/engine#get_view_angles) get\_view\_angles Copy local pitch, yaw = engine.get_view_angles() #### [hashtag](https://golua.fatality.win/documentation/namespaces/engine#returns-3) Returns: [Value](https://golua.fatality.win/documentation/namespaces/engine) [Datatype](https://golua.fatality.win/documentation/namespaces/engine) pitch number yaw number ### [hashtag](https://golua.fatality.win/documentation/namespaces/engine#set_view_angles) set\_view\_angles Copy engine.set_view_angles(0, 90) [Parameter](https://golua.fatality.win/documentation/namespaces/engine) [Datatype](https://golua.fatality.win/documentation/namespaces/engine) [Description](https://golua.fatality.win/documentation/namespaces/engine) pitch number pitch angle (-90 - 90) yaw number yaw angle (0 - 360) or (-180 - 180) ### [hashtag](https://golua.fatality.win/documentation/namespaces/engine#is_in_game) is\_in\_game Copy engine.is_in_game() #### [hashtag](https://golua.fatality.win/documentation/namespaces/engine#returns-4) Returns: [Value](https://golua.fatality.win/documentation/namespaces/engine) [Datatype](https://golua.fatality.win/documentation/namespaces/engine) true if you are in a game boolean ### [hashtag](https://golua.fatality.win/documentation/namespaces/engine#exec) exec Copy engine.exec("say hello from engine cmd") [Parameter](https://golua.fatality.win/documentation/namespaces/engine) [Datatype](https://golua.fatality.win/documentation/namespaces/engine) [Description](https://golua.fatality.win/documentation/namespaces/engine) con\_command string console command to execute [PreviousRenderchevron-left](https://golua.fatality.win/documentation/namespaces/render) [NextMathchevron-right](https://golua.fatality.win/documentation/namespaces/math) Last updated 3 years ago --- # Useful resources | Lua API [hashtag](https://golua.fatality.win/getting-started/useful-resources#calculating-fov-between-two-points) Calculating fov between two points ------------------------------------------------------------------------------------------------------------------------------------------------- Copy local function CalculateFov(Start, End, Angle) local Direction = (End - Start):normalize() local Forward, Right, Up = math.angle_vectors(Angle) return math.max(math.deg(math.acos(Forward:dot(Direction))), 0) end local fov = CalculateFov(eye_pos, point_in_world, math.vec3(pitch, yaw, 0)) [hashtag](https://golua.fatality.win/getting-started/useful-resources#bit-utilities) Bit utilities ------------------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/getting-started/useful-resources#setting-specific-bits) Setting specific bits Copy bit.bset = function(number, b, value) if value ~= 0 then return bit.bor(number, bit.lshift(1, math.log(b, 2))) else return bit.band(number, bit.bnot(bit.lshift(1, math.log(b, 2)))) end end cmd:set_buttons(bit.bset(cmd:get_buttons(), csgo.in_jump, 1)) [hashtag](https://golua.fatality.win/getting-started/useful-resources#ffi-utilities) FFI utilities ------------------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/getting-started/useful-resources#vtable_bind) vtable\_bind Copy local function vtable_bind(class, type, index) local this = ffi.cast("void***", class) local ffi_type = ffi.typeof(type) return function (...) return ffi.cast(ffi_type, this[0][index])(this, ...) end end -- Example local VClientEntityList = utils.find_interface("client.dll", "VClientEntityList003") local GetClientEntityFN = vtable_bind(VClientEntityList, "void*(__thiscall*)(void*, int)", 3) local RawLocalPlayer = GetClientEntityFN(engine.get_local_player()) ### [hashtag](https://golua.fatality.win/getting-started/useful-resources#vtable_thunk) vtable\_thunk Copy local function vtable_thunk(type, index) local ffi_type = ffi.typeof(type) return function (class, ...) local this = ffi.cast("void***", class) return ffi.cast(ffi_type, this[0][index])(this, ...) end end -- Example local VClientEntityList = utils.find_interface("client.dll", "VClientEntityList003") local GetClientEntityFN = vtable_thunk("void*(__thiscall*)(void*, int)", 3) local RawLocalPlayer = GetClientEntityFN(VClientEntityList, engine.get_local_player()) ### [hashtag](https://golua.fatality.win/getting-started/useful-resources#follow-relative-x86) Follow relative x86 Follows relative address and returns the real address Copy local function Followx86(addr) return addr + ffi.cast("uint32_t*", addr + 1)[0] + 5; end circle-info Credit: Panzerfaust [hashtag](https://golua.fatality.win/getting-started/useful-resources#misc) Misc ------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/getting-started/useful-resources#inline-hex-colors-on-text) Inline hex colors on text Copy -- backup the original text function for later use local render_text_og = render.text local render_get_text_size_og = render.get_text_size -- turns a color table into a hex string local function ColorToHex(c) return string.format("%02x%02x%02x%02x", c.r, c.g, c.b, c.a) end -- redifine text size to ignore inline hex render.get_text_size = function (id, text) local s = text:gsub("\a(%x%x%x%x%x%x%x%x)", "") local w, h = render_get_text_size_og(id, s) -- fix fucked up font height. you can add more here if id == render.font_esp then h = h * 0.625 end return w, h end -- redefine the render.text function to support rendering inline hex codes render.text = function(font, x, y, str, color, align_h, align_v) -- Done if str:len() == 0 then return end if align_h or align_v then local txt_w, txt_h = render.get_text_size(font, str) if align_h == render.align_right then x = x - txt_w elseif align_h == render.align_center then x = x - txt_w / 2 end if align_v == render.align_bottom then y = y - txt_h elseif align_v == render.align_center then y = y - txt_h / 2 end end -- Find the first hex pattern local Start, End = string.find(str, "\a(%x%x%x%x%x%x%x%x)") if Start then -- If we have text before the pattern filter it out if Start ~= 1 then -- Get the string that is before the hex code local RenderString = str:sub(0, Start - 1) render_text_og(font, x, y, RenderString, color) -- Add the width to x local TextSizeX, TextSizeY = render_get_text_size_og(font, RenderString) -- Set our new string to be the start of the hex code aka the \a str = str:sub(Start, str:len()) -- recursion render.text(font, x + TextSizeX, y, str, color) else -- Get the remaining length (used incase there are more hex codes) local StringEnd = str:len() -- Calculate the render string as if there are no remaining codes local RenderString = str:sub(End + 1, StringEnd) -- Check if there are more codes local SecondSearch, SecondEnd = str.find(RenderString, "\a(%x%x%x%x%x%x%x%x)") -- If so set our string to end at the last character before the next code -- and set our new end position if SecondSearch then RenderString = str:sub(End + 1, SecondEnd) StringEnd = SecondEnd end -- Calculate the color from the code local HexCode = str:sub(Start + 1, End) color = render.color("#" .. HexCode) render_text_og(font, x, y, RenderString, color) -- Add the width to the x position local TextSizeX, TextSizeY = render_get_text_size_og(font, RenderString) -- Setup our new string for recursion str = str:sub(StringEnd + 1, str:len()) render.text(font, x + TextSizeX, y, str, color) end else -- No codes were used render_text_og(font, x, y, str, color) end end Copy function on_paint() render.text(render.font_esp, x, y, "base color \aff0000ffred", render.color("#FFFFFF")) end ![Example](https://golua.fatality.win/~gitbook/image?url=https%3A%2F%2Fi.imgur.com%2FcPUE4pm.png&width=768&dpr=3&quality=100&sign=e75d2ab6&sv=2) ### [hashtag](https://golua.fatality.win/getting-started/useful-resources#fade-percentage) Fade percentage Copy --- @param x number 0 - 1 --- @param in_percent number 0 - 1 --- @param out_percent number 0 - 1 --- @return number math.fade_delta = function(x, in_percent, out_percent) if (x > (1 - in_percent)) then x = (in_percent - ( x - (1 - in_percent))) / in_percent; else x = math.min( x * (1 / out_percent), 1.0 ); end return x end [PreviousExampleschevron-left](https://golua.fatality.win/getting-started/examples) [NextNamespaceschevron-right](https://golua.fatality.win/documentation/namespaces) Last updated 2 years ago --- # Callbacks | Lua API circle-info Although this api does not use true callbacks, they will be referred to as such. [hashtag](https://golua.fatality.win/getting-started/callbacks#how-to-use) How to use ------------------------------------------------------------------------------------------ To create a callback you need to use one of the many names listed below to access them. Copy -- Callbacks CANNOT be local -- "local function on_shot_fired" will not work function on_shot_fired(shot_info) print(string.format("Expected damage: %i", shot_info.client_damage) end function on_paint() render.rect_filled(10, 10, 110, 110, render.color("#FFFFFF")) end [hashtag](https://golua.fatality.win/getting-started/callbacks#callbacks) Callbacks ---------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_paint) on\_paint Called every frame. Use to draw with the [render](https://golua.fatality.win/documentation/namespaces/render) namespace. Copy function on_paint() render.rect_filled(10, 10, 110, 110, render.color("#FFFFFF")) end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_paint_traverse) on\_paint\_traverse Called every frame. Use this to call surface functions with ffi. Copy function on_paint_traverse() end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_frame_stage_notify) on\_frame\_stage\_notify Called when on a specific [framearrow-up-right](https://developer.valvesoftware.com/wiki/Frame_Order) . [Parameter](https://golua.fatality.win/getting-started/callbacks) [Datatype](https://golua.fatality.win/getting-started/callbacks) [Description](https://golua.fatality.win/getting-started/callbacks) stage [csgo.frame\_stage](https://golua.fatality.win/getting-started/callbacks#frame-stages) stage called on pre\_original boolean whether or not frame\_stage\_notify has been called yet Copy function on_frame_stage_notify(stage, pre_original) if stage == csgo.frame_render_start then print("Rendering has started!") end end chevron-rightStages[hashtag](https://golua.fatality.win/getting-started/callbacks#stages) * csgo.frame\_render\_end * csgo.frame\_net\_update\_end * csgo.frame\_net\_update\_postdataupdate\_end * csgo.frame\_net\_update\_postdataupdate\_start * csgo.frame\_net\_update\_start * csgo.frame\_render\_start * csgo.frame\_start * csgo.frame\_undefined ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_setup_move) on\_setup\_move Called every game tick before the command is used internally. Use to call movement-related things. [Parameter](https://golua.fatality.win/getting-started/callbacks) [Datatype](https://golua.fatality.win/getting-started/callbacks) [Description](https://golua.fatality.win/getting-started/callbacks) cmd [user\_cmd](https://golua.fatality.win/documentation/datatypes/user_cmd) user command Copy function on_setup_move(cmd) cmd:set_move(xxx) end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_run_command) on\_run\_command Called for every tick in a choked cycle the moment it is going to be sent to the server, after the cheat's anti-aim has run. Use to change angles without cheat interference. All angle changes will be movement corrected. [Parameter](https://golua.fatality.win/getting-started/callbacks) [Datatype](https://golua.fatality.win/getting-started/callbacks) [Description](https://golua.fatality.win/getting-started/callbacks) cmd [user\_cmd](https://golua.fatality.win/documentation/datatypes/user_cmd) user command Copy function on_run_command(cmd) cmd:set_view_angles(xxx) end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_create_move) on\_create\_move Called every game tick after everything internally has finished. Use to run something on a per-tick basis that does not modify commands. [Parameter](https://golua.fatality.win/getting-started/callbacks) [Datatype](https://golua.fatality.win/getting-started/callbacks) [Description](https://golua.fatality.win/getting-started/callbacks) cmd [user\_cmd](https://golua.fatality.win/documentation/datatypes/user_cmd) user command send\_packet boolean true if a packet will be sent Copy function on_create_move(cmd, send_packet) do_anti_aim() end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_input) on\_input Called on [wndprocarrow-up-right](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nc-winuser-wndproc) . [Parameter](https://golua.fatality.win/getting-started/callbacks) [Datatype](https://golua.fatality.win/getting-started/callbacks) [Description](https://golua.fatality.win/getting-started/callbacks) msg number [window messagearrow-up-right](https://wiki.winehq.org/List_Of_Windows_Messages) wParam number used to pass values with specific messages lParam number used to pass values with specific messages Copy function on_input(msg, wParam, lParam) end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_console_input) on\_console\_input [Parameter](https://golua.fatality.win/getting-started/callbacks) [Datatype](https://golua.fatality.win/getting-started/callbacks) [Description](https://golua.fatality.win/getting-started/callbacks) input string console input Copy function on_console_input(input) end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_shutdown) on\_shutdown Called when the script is unloaded. Copy function on_shutdown() end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_shot_registered) on\_shot\_registered Called after a shot has been fired. Use to get information about shots. [Parameter](https://golua.fatality.win/getting-started/callbacks) [Datatype](https://golua.fatality.win/getting-started/callbacks) [Description](https://golua.fatality.win/getting-started/callbacks) shot\_info [shot\_info](https://golua.fatality.win/documentation/datatypes/shot_info) the shots information Copy function on_shot_registered(shot_info) print(string.format("Expected damage: %i", shot_info.client_damage)) end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_level_init) on\_level\_init Called after the map has loaded. Copy function on_level_init() end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_game_event) on\_game\_event Called on any game event. [Parameter](https://golua.fatality.win/getting-started/callbacks) [Datatype](https://golua.fatality.win/getting-started/callbacks) [Description](https://golua.fatality.win/getting-started/callbacks) event [game\_event](https://golua.fatality.win/documentation/datatypes/game_event) game event Copy function on_game_event(event) end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_xxx) on\_xxx Called on a specific game event. Read the [list of eventsarrow-up-right](https://wiki.alliedmods.net/Counter-Strike:_Global_Offensive_Events) and prefix one with "on\_" to set a callback to it. [Parameter](https://golua.fatality.win/getting-started/callbacks) [Datatype](https://golua.fatality.win/getting-started/callbacks) [Description](https://golua.fatality.win/getting-started/callbacks) event [game\_event](https://golua.fatality.win/documentation/datatypes/game_event) game event Copy function on_item_pickup(event) end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_do_post_screen_space_events) on\_do\_post\_screen\_space\_events Called after post processing has finished. Copy function on_do_post_screen_space_events() end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_config_load) on\_config\_load Called after a config is loaded. Copy function on_config_load() end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_config_save) on\_config\_save Called after a config has been saved. Copy function on_config_save() end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_esp_flag) on\_esp\_flag [Parameter](https://golua.fatality.win/getting-started/callbacks) [Datatype](https://golua.fatality.win/getting-started/callbacks) [Description](https://golua.fatality.win/getting-started/callbacks) index integer index of player drawing circle-info Return a table of flags that you want to add Copy function on_esp_flag(index) return { render.esp_flag("first extra flag", render.color("#FFFFFF")), render.esp_flag("second extra flag", render.color("#FFFFFF")), } end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_draw_model_execute) on\_draw\_model\_execute [Parameter](https://golua.fatality.win/getting-started/callbacks) [Datatype](https://golua.fatality.win/getting-started/callbacks) [Description](https://golua.fatality.win/getting-started/callbacks) dme function calls dme (draws the model) ent\_index integer entity's index model\_name string model's name Copy function on_draw_model_execute(dme, ent_index, model_name) -- How to do overlay cham dme() -- call dme to draw the model with the normal material mat.override_material(overlay_mat) -- set the overlay material -- you do not need to call dme again. it is called after the callback end [hashtag](https://golua.fatality.win/getting-started/callbacks#player-callbacks) Player callbacks ------------------------------------------------------------------------------------------------------ ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_player_connect) on\_player\_connect Called after a player has connected. [Parameter](https://golua.fatality.win/getting-started/callbacks) [Datatype](https://golua.fatality.win/getting-started/callbacks) [Description](https://golua.fatality.win/getting-started/callbacks) event [game\_event](https://golua.fatality.win/documentation/datatypes/game_event) game event Copy function on_player_connect(event) print("player connected") end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_player_disconnect) on\_player\_disconnect Called after a player has disconnected. [Parameter](https://golua.fatality.win/getting-started/callbacks) [Datatype](https://golua.fatality.win/getting-started/callbacks) [Description](https://golua.fatality.win/getting-started/callbacks) event [game\_event](https://golua.fatality.win/documentation/datatypes/game_event) game event Copy function on_player_disconnect(event) end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_player_spawn) on\_player\_spawn Called after a player has spawned. [Parameter](https://golua.fatality.win/getting-started/callbacks) [Datatype](https://golua.fatality.win/getting-started/callbacks) [Description](https://golua.fatality.win/getting-started/callbacks) event [game\_event](https://golua.fatality.win/documentation/datatypes/game_event) game event Copy function on_player_spawn(event) end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_player_hurt) on\_player\_hurt Called after a player has been hurt. [Parameter](https://golua.fatality.win/getting-started/callbacks) [Datatype](https://golua.fatality.win/getting-started/callbacks) [Description](https://golua.fatality.win/getting-started/callbacks) event [game\_event](https://golua.fatality.win/documentation/datatypes/game_event) game event Copy function on_player_hurt(event) end ### [hashtag](https://golua.fatality.win/getting-started/callbacks#on_player_death) on\_player\_death Called after a player has died. [Parameter](https://golua.fatality.win/getting-started/callbacks) [Datatype](https://golua.fatality.win/getting-started/callbacks) [Description](https://golua.fatality.win/getting-started/callbacks) event [game\_event](https://golua.fatality.win/documentation/datatypes/game_event) game event Copy function on_player_death(event) end [PreviousMetadatachevron-left](https://golua.fatality.win/getting-started/metadata) [NextExampleschevron-right](https://golua.fatality.win/getting-started/examples) Last updated 3 years ago --- # Namespaces | Lua API [🖥️Guichevron-right](https://golua.fatality.win/documentation/namespaces/gui) [✏️Renderchevron-right](https://golua.fatality.win/documentation/namespaces/render) [🏎️Enginechevron-right](https://golua.fatality.win/documentation/namespaces/engine) [🔢Mathchevron-right](https://golua.fatality.win/documentation/namespaces/math) [⚙️Utilitieschevron-right](https://golua.fatality.win/documentation/namespaces/utilities) [🙎Entitieschevron-right](https://golua.fatality.win/documentation/namespaces/entities) [📖Databasechevron-right](https://golua.fatality.win/documentation/namespaces/database) [🖱️Inputchevron-right](https://golua.fatality.win/documentation/namespaces/input) [🌌Panoramachevron-right](https://golua.fatality.win/documentation/namespaces/panorama) [🪶Materialschevron-right](https://golua.fatality.win/documentation/namespaces/materials) [📂Filesystemchevron-right](https://golua.fatality.win/documentation/namespaces/filesystem) [🗃️Zipchevron-right](https://golua.fatality.win/documentation/namespaces/zip) [PreviousUseful resourceschevron-left](https://golua.fatality.win/getting-started/useful-resources) [NextGuichevron-right](https://golua.fatality.win/documentation/namespaces/gui) Last updated 2 years ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Math | Lua API [hashtag](https://golua.fatality.win/documentation/namespaces/math#functions) Functions -------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/math#vec3) vec3 Copy local new_vec = math.vec3(10, 0, 0) [Parameter](https://golua.fatality.win/documentation/namespaces/math) [Datatype](https://golua.fatality.win/documentation/namespaces/math) [Default](https://golua.fatality.win/documentation/namespaces/math) x number ❌ y number parameter x z number parameter x #### [hashtag](https://golua.fatality.win/documentation/namespaces/math#returns) Returns: [Value](https://golua.fatality.win/documentation/namespaces/math) [Datatype](https://golua.fatality.win/documentation/namespaces/math) vector object [math.vec3](https://golua.fatality.win/documentation/datatypes/vec3) ### [hashtag](https://golua.fatality.win/documentation/namespaces/math#vector_angles) vector\_angles Copy math.vector_angles(math.vec3(0.5, 0.2, 0.8)) [Parameter](https://golua.fatality.win/documentation/namespaces/math) [Datatype](https://golua.fatality.win/documentation/namespaces/math) [Description](https://golua.fatality.win/documentation/namespaces/math) forward [math.vec3](https://golua.fatality.win/documentation/datatypes/vec3) the forward vector to convert to angles #### [hashtag](https://golua.fatality.win/documentation/namespaces/math#returns-1) Returns: [Value](https://golua.fatality.win/documentation/namespaces/math) [Datatype](https://golua.fatality.win/documentation/namespaces/math) angles [math.vec3](https://golua.fatality.win/documentation/datatypes/vec3) ### [hashtag](https://golua.fatality.win/documentation/namespaces/math#angle_vectors) angle\_vectors [Parameter](https://golua.fatality.win/documentation/namespaces/math) [Datatype](https://golua.fatality.win/documentation/namespaces/math) [Description](https://golua.fatality.win/documentation/namespaces/math) angle [math.vec3](https://golua.fatality.win/documentation/datatypes/vec3) the angle to convert to directions #### [hashtag](https://golua.fatality.win/documentation/namespaces/math#returns-2) Returns: [Value](https://golua.fatality.win/documentation/namespaces/math) [Datatype](https://golua.fatality.win/documentation/namespaces/math) forward [math.vec3](https://golua.fatality.win/documentation/datatypes/vec3) right [math.vec3](https://golua.fatality.win/documentation/datatypes/vec3) up [math.vec3](https://golua.fatality.win/documentation/datatypes/vec3) [PreviousEnginechevron-left](https://golua.fatality.win/documentation/namespaces/engine) [NextUtilitieschevron-right](https://golua.fatality.win/documentation/namespaces/utilities) Last updated 3 years ago * [Functions](https://golua.fatality.win/documentation/namespaces/math#functions) * [vec3](https://golua.fatality.win/documentation/namespaces/math#vec3) * [vector\_angles](https://golua.fatality.win/documentation/namespaces/math#vector_angles) * [angle\_vectors](https://golua.fatality.win/documentation/namespaces/math#angle_vectors) sun-brightdesktopmoon Copy math.angle_vectors(math.vec3(0, 90, 0)) sun-brightdesktopmoon --- # Entities | Lua API [hashtag](https://golua.fatality.win/documentation/namespaces/entities#functions) Functions ------------------------------------------------------------------------------------------------ ### [hashtag](https://golua.fatality.win/documentation/namespaces/entities#get_entity) get\_entity Copy entities.get_entity(engine.get_local_player()) [Parameter](https://golua.fatality.win/documentation/namespaces/entities) [Datatype](https://golua.fatality.win/documentation/namespaces/entities) [Description](https://golua.fatality.win/documentation/namespaces/entities) entity index number entity's server index #### [hashtag](https://golua.fatality.win/documentation/namespaces/entities#returns) Returns: [Value](https://golua.fatality.win/documentation/namespaces/entities) [Datatype](https://golua.fatality.win/documentation/namespaces/entities) entity's object [entity](https://golua.fatality.win/documentation/datatypes/entity) ### [hashtag](https://golua.fatality.win/documentation/namespaces/entities#get_entity_from_handle) get\_entity\_from\_handle Copy entities.get_entity_from_handle(local_player:get_prop("m_hMyWeapons", 1)) [Parameter](https://golua.fatality.win/documentation/namespaces/entities) [Datatype](https://golua.fatality.win/documentation/namespaces/entities) [Description](https://golua.fatality.win/documentation/namespaces/entities) entity handle number a handle to the entity ex: m\_hMyWeapons\[1\] #### [hashtag](https://golua.fatality.win/documentation/namespaces/entities#returns-1) Returns: [Value](https://golua.fatality.win/documentation/namespaces/entities) [Datatype](https://golua.fatality.win/documentation/namespaces/entities) entity's object [entity](https://golua.fatality.win/documentation/datatypes/entity) ### [hashtag](https://golua.fatality.win/documentation/namespaces/entities#for_each) for\_each [Parameter](https://golua.fatality.win/documentation/namespaces/entities) [Datatype](https://golua.fatality.win/documentation/namespaces/entities) [Description](https://golua.fatality.win/documentation/namespaces/entities) function callback function A function to use as a callback. Must have 1 argument for the entity. #### [hashtag](https://golua.fatality.win/documentation/namespaces/entities#usage) Usage: Runs for each entity on the server. ### [hashtag](https://golua.fatality.win/documentation/namespaces/entities#for_each_z) for\_each\_z [Parameter](https://golua.fatality.win/documentation/namespaces/entities) [Datatype](https://golua.fatality.win/documentation/namespaces/entities) [Description](https://golua.fatality.win/documentation/namespaces/entities) function callback function A function to use as a callback. Must have 1 argument for the entity. #### [hashtag](https://golua.fatality.win/documentation/namespaces/entities#usage-1) Usage: Runs for each entity on the server starting from the end. ### [hashtag](https://golua.fatality.win/documentation/namespaces/entities#for_each_player) for\_each\_player [Parameter](https://golua.fatality.win/documentation/namespaces/entities) [Datatype](https://golua.fatality.win/documentation/namespaces/entities) [Description](https://golua.fatality.win/documentation/namespaces/entities) function callback function A function to use as a callback. Must have 1 argument for the player. #### [hashtag](https://golua.fatality.win/documentation/namespaces/entities#usage-2) Usage: Runs for each player on the server. [PreviousUtilitieschevron-left](https://golua.fatality.win/documentation/namespaces/utilities) [NextDatabasechevron-right](https://golua.fatality.win/documentation/namespaces/database) Last updated 3 years ago * [Functions](https://golua.fatality.win/documentation/namespaces/entities#functions) * [get\_entity](https://golua.fatality.win/documentation/namespaces/entities#get_entity) * [get\_entity\_from\_handle](https://golua.fatality.win/documentation/namespaces/entities#get_entity_from_handle) * [for\_each](https://golua.fatality.win/documentation/namespaces/entities#for_each) * [for\_each\_z](https://golua.fatality.win/documentation/namespaces/entities#for_each_z) * [for\_each\_player](https://golua.fatality.win/documentation/namespaces/entities#for_each_player) sun-brightdesktopmoon Copy entities.for_each(function(entity) print(string.format("Entity's index: %i", entity:get_index())) end) Copy entities.for_each_z(function(entity) print(string.format("Entity's index: %i", entity:get_index())) end) Copy entities.for_each_player(function(player) print(string.format("Player: %i has %i health", player:get_index(), player:get_prop("m_iHealth"))) end) sun-brightdesktopmoon --- # Panorama | Lua API [hashtag](https://golua.fatality.win/documentation/namespaces/panorama#functions) Functions ------------------------------------------------------------------------------------------------ ### [hashtag](https://golua.fatality.win/documentation/namespaces/panorama#eval) eval Copy panorama.eval(panorama_javascript) [Parameter](https://golua.fatality.win/documentation/namespaces/panorama) [Datatype](https://golua.fatality.win/documentation/namespaces/panorama) [Description](https://golua.fatality.win/documentation/namespaces/panorama) javascript string javascript to execute #### [hashtag](https://golua.fatality.win/documentation/namespaces/panorama#returns) Returns: [Parameter](https://golua.fatality.win/documentation/namespaces/panorama) [Datatype](https://golua.fatality.win/documentation/namespaces/panorama) [Description](https://golua.fatality.win/documentation/namespaces/panorama) value any returns whatever you return in the javascript [PreviousInputchevron-left](https://golua.fatality.win/documentation/namespaces/input) [NextMaterialschevron-right](https://golua.fatality.win/documentation/namespaces/materials) Last updated 3 years ago * [Functions](https://golua.fatality.win/documentation/namespaces/panorama#functions) * [eval](https://golua.fatality.win/documentation/namespaces/panorama#eval) sun-brightdesktopmoon sun-brightdesktopmoon --- # Input | Lua API [hashtag](https://golua.fatality.win/documentation/namespaces/input#functions) Functions --------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/input#is_key_down) is\_key\_down Copy local state = input.is_key_down(0x1) [Parameter](https://golua.fatality.win/documentation/namespaces/input) [Datatype](https://golua.fatality.win/documentation/namespaces/input) [Description](https://golua.fatality.win/documentation/namespaces/input) key\_code number key's [virtual key codearrow-up-right](https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes) #### [hashtag](https://golua.fatality.win/documentation/namespaces/input#returns) Returns: [Value](https://golua.fatality.win/documentation/namespaces/input) [Datatype](https://golua.fatality.win/documentation/namespaces/input) key's state boolean ### [hashtag](https://golua.fatality.win/documentation/namespaces/input#get_cursor_pos) get\_cursor\_pos Copy local x, y = input.get_cursor_pos() #### [hashtag](https://golua.fatality.win/documentation/namespaces/input#returns-1) Returns: [Value](https://golua.fatality.win/documentation/namespaces/input) [Datatype](https://golua.fatality.win/documentation/namespaces/input) mouse cursor x position number mouse cursor y position number [PreviousDatabasechevron-left](https://golua.fatality.win/documentation/namespaces/database) [NextPanoramachevron-right](https://golua.fatality.win/documentation/namespaces/panorama) Last updated 3 years ago * [Functions](https://golua.fatality.win/documentation/namespaces/input#functions) * [is\_key\_down](https://golua.fatality.win/documentation/namespaces/input#is_key_down) * [get\_cursor\_pos](https://golua.fatality.win/documentation/namespaces/input#get_cursor_pos) sun-brightdesktopmoon sun-brightdesktopmoon --- # Database | Lua API [hashtag](https://golua.fatality.win/documentation/namespaces/database#functions) Functions ------------------------------------------------------------------------------------------------ ### [hashtag](https://golua.fatality.win/documentation/namespaces/database#load) load Copy local database_info = database.load("some_database.db") #### [hashtag](https://golua.fatality.win/documentation/namespaces/database#returns) Returns: [Parameter](https://golua.fatality.win/documentation/namespaces/database) [Datatype](https://golua.fatality.win/documentation/namespaces/database) database\_info table, string, number, or nil on failure ### [hashtag](https://golua.fatality.win/documentation/namespaces/database#save) save Copy local database_info = { some_value = 5, some_string = "fatality.win" } database.save("some_database.db", database_info) [Parameter](https://golua.fatality.win/documentation/namespaces/database) [Datatype](https://golua.fatality.win/documentation/namespaces/database) [Description](https://golua.fatality.win/documentation/datatypes) database\_name string name of database value table, string, or number value to store triangle-exclamation Saving a database will overwrite all info previously stored inside of it! circle-info Files are stored in ./fatality/database/ [PreviousEntitieschevron-left](https://golua.fatality.win/documentation/namespaces/entities) [NextInputchevron-right](https://golua.fatality.win/documentation/namespaces/input) Last updated 3 years ago * [Functions](https://golua.fatality.win/documentation/namespaces/database#functions) * [load](https://golua.fatality.win/documentation/namespaces/database#load) * [save](https://golua.fatality.win/documentation/namespaces/database#save) sun-brightdesktopmoon sun-brightdesktopmoon --- # Global Vars | Lua API [Variable name](https://golua.fatality.win/documentation/datatypes/weapon_info) [Datatype](https://golua.fatality.win/documentation/datatypes/weapon_info) [Description](https://golua.fatality.win/documentation/datatypes/weapon_info) realtime number absolute time framecount number absolute frame count curtime number client clock frametime number delta time between frames tickcount number server frame count interval\_per\_tick number server delta time [hashtag](https://golua.fatality.win/documentation/instances/global-vars#example) Example ---------------------------------------------------------------------------------------------- Copy local fps = 1 / global_vars.frametime; local tickrate = 1 / global_vars.interval_per_tick [PreviousInstanceschevron-left](https://golua.fatality.win/documentation/instances) [NextFatalitychevron-right](https://golua.fatality.win/documentation/instances/fatality) Last updated 2 years ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Fatality | Lua API [Variable name](https://golua.fatality.win/documentation/instances/fatality) [Datatype](https://golua.fatality.win/documentation/instances/fatality) [Description](https://golua.fatality.win/documentation/instances/fatality) username string your forum username lag\_ticks number number of commands being choked currently desync number desync delta can\_fastfire boolean can you double tap in\_fakeduck boolean are you fake ducking in\_slowwalk boolean are you slow walking allow\_insecure boolean are you allowing potentially malicious functions (ex: [utils.find\_pattern](https://golua.fatality.win/documentation/namespaces/utilities#find_pattern) ) [hashtag](https://golua.fatality.win/documentation/instances/fatality#example) Example ------------------------------------------------------------------------------------------- Copy local forum_name = info.fatality.username local current_lag = info.fatality.lag_ticks [PreviousGlobal Varschevron-left](https://golua.fatality.win/documentation/instances/global-vars) [NextGameruleschevron-right](https://golua.fatality.win/documentation/instances/gamerules) Last updated 2 years ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Instances | Lua API [⚙️Global Varschevron-right](https://golua.fatality.win/documentation/instances/global-vars) [⚙️Fatalitychevron-right](https://golua.fatality.win/documentation/instances/fatality) [⚙️Gameruleschevron-right](https://golua.fatality.win/documentation/instances/gamerules) [⚙️Serverchevron-right](https://golua.fatality.win/documentation/instances/server) [PreviousZipchevron-left](https://golua.fatality.win/documentation/namespaces/zip) [NextGlobal Varschevron-right](https://golua.fatality.win/documentation/instances/global-vars) Last updated 2 years ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Server | Lua API [Variable name](https://golua.fatality.win/documentation/instances/server) [Datatype](https://golua.fatality.win/documentation/instances/server) [Description](https://golua.fatality.win/documentation/instances/server) map\_name string current map (ex: de\_mirage) address string server ip address max\_players number max number of players allowed on the server [hashtag](https://golua.fatality.win/documentation/instances/server#example) Example ----------------------------------------------------------------------------------------- Copy print(string.format("Server IP: %s", info.server.address)) [PreviousGameruleschevron-left](https://golua.fatality.win/documentation/instances/gamerules) [NextDatatypeschevron-right](https://golua.fatality.win/documentation/datatypes) Last updated 2 years ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Gamerules | Lua API [Variable name](https://golua.fatality.win/documentation/instances/gamerules) [Datatype](https://golua.fatality.win/documentation/instances/gamerules) [Description](https://golua.fatality.win/documentation/instances/gamerules) is\_valve\_server boolean is it a valve run server (ex: matchmaking) is\_freeze\_period boolean is the game currently in freeze period (ex: the start of the round) [hashtag](https://golua.fatality.win/documentation/instances/gamerules#example) Example -------------------------------------------------------------------------------------------- Copy local is_valve = game_rules.is_valve_server local freeze_period = game_rules.is_freeze_period [PreviousFatalitychevron-left](https://golua.fatality.win/documentation/instances/fatality) [NextServerchevron-right](https://golua.fatality.win/documentation/instances/server) Last updated 2 years ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Materials | Lua API [hashtag](https://golua.fatality.win/documentation/namespaces/materials#functions) Functions ------------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/materials#create) create Copy mat.create("dank_material", "VertexLitGeneric", [[\ "VertexLitGeneric"\ {\ "$ambientonly" 1 \ }\ ]]) [Parameter](https://golua.fatality.win/documentation/namespaces/materials) [Datatype](https://golua.fatality.win/documentation/namespaces/materials) [Description](https://golua.fatality.win/documentation/namespaces/materials) name string name of your material type string shader type key\_values string material key values #### [hashtag](https://golua.fatality.win/documentation/namespaces/materials#returns) Returns: [Value](https://golua.fatality.win/documentation/namespaces/materials) [Datatype](https://golua.fatality.win/documentation/namespaces/materials) material object [material](https://golua.fatality.win/documentation/datatypes/material) ### [hashtag](https://golua.fatality.win/documentation/namespaces/materials#find) find [Parameter](https://golua.fatality.win/documentation/namespaces/materials) [Datatype](https://golua.fatality.win/documentation/namespaces/materials) [Description](https://golua.fatality.win/documentation/namespaces/materials) name string material name texture\_group string [material texture grouparrow-up-right](https://github.com/ValveSoftware/source-sdk-2013/blob/master/sp/src/public/texture_group_names.h) #### [hashtag](https://golua.fatality.win/documentation/namespaces/materials#returns-1) Returns: [Value](https://golua.fatality.win/documentation/namespaces/materials) [Datatype](https://golua.fatality.win/documentation/namespaces/materials) material object [material](https://golua.fatality.win/documentation/datatypes/material) ### [hashtag](https://golua.fatality.win/documentation/namespaces/materials#for_each_material) for\_each\_material [Parameter](https://golua.fatality.win/documentation/namespaces/materials) [Datatype](https://golua.fatality.win/documentation/namespaces/materials) [Description](https://golua.fatality.win/documentation/namespaces/materials) callback function callback called for each material ### [hashtag](https://golua.fatality.win/documentation/namespaces/materials#override_material) override\_material [Parameter](https://golua.fatality.win/documentation/namespaces/materials) [Datatype](https://golua.fatality.win/documentation/namespaces/materials) [Description](https://golua.fatality.win/documentation/namespaces/materials) material [material](https://golua.fatality.win/documentation/datatypes/material) material to override to [PreviousPanoramachevron-left](https://golua.fatality.win/documentation/namespaces/panorama) [NextFilesystemchevron-right](https://golua.fatality.win/documentation/namespaces/filesystem) Last updated 3 years ago * [Functions](https://golua.fatality.win/documentation/namespaces/materials#functions) * [create](https://golua.fatality.win/documentation/namespaces/materials#create) * [find](https://golua.fatality.win/documentation/namespaces/materials#find) * [for\_each\_material](https://golua.fatality.win/documentation/namespaces/materials#for_each_material) * [override\_material](https://golua.fatality.win/documentation/namespaces/materials#override_material) sun-brightdesktopmoon Copy mat.find("debug/ambientcube", "Other Textures") Copy mat.for_each_material(function(material) print(material:get_name()) end) Copy mat.override_material(some_material) sun-brightdesktopmoon --- # Gui | Lua API circle-info If you need to get a container ID or an existing control ID, enable `**LUA>GENERAL>**`![](https://golua.fatality.win/~gitbook/image?url=https%3A%2F%2F3509372639-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FafgbISA4aNSPwgb4N4AD%252Fuploads%252FWTewlqpT9SRqrznl78pR%252Fbug%2520%281%29.svg%3Falt%3Dmedia%26token%3D720a37f3-5b13-4ffe-a448-ab383598e797&width=300&dpr=3&quality=100&sign=4864a829&sv=2)`**Debug mode**` and hover on a groupbox or any element. circle-info You can stack most control in line with other controls. To do that, pass the ID of a control that already exists into the `container_id` argument of the function. [hashtag](https://golua.fatality.win/documentation/namespaces/gui#enums) Enums ----------------------------------------------------------------------------------- chevron-rightHotkey modes[hashtag](https://golua.fatality.win/documentation/namespaces/gui#hotkey-modes) * hotkey\_toggle * hotkey\_hold chevron-rightDialog buttons[hashtag](https://golua.fatality.win/documentation/namespaces/gui#dialog-buttons) * dialog\_buttons\_ok\_cancel * dialog\_buttons\_yes\_no * dialog\_buttons\_yes\_no\_cancel chevron-rightDialog result[hashtag](https://golua.fatality.win/documentation/namespaces/gui#dialog-result) * dialog\_result\_affirmative * dialog\_result\_negative [hashtag](https://golua.fatality.win/documentation/namespaces/gui#controls) Controls ----------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#checkbox) checkbox [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) id string new id container\_id string container id label string label #### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#returns) Returns: [Value](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) checkbox [checkbox](https://golua.fatality.win/documentation/datatypes/checkbox) ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#get_checkbox) get\_checkbox [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) id string control id #### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#returns-1) Returns: [Value](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) checkbox [checkbox](https://golua.fatality.win/documentation/datatypes/checkbox) ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#slider) slider [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) [Default value](https://golua.fatality.win/documentation/namespaces/gui) id string new id ❌ container\_id string container id ❌ label string label ❌ min number minimum slider value ❌ max number maximum slider value ❌ format string format string '%.0f' step number step value 1.0 #### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#returns-2) Returns: [Value](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) slider [slider](https://golua.fatality.win/documentation/datatypes/slider) ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#get_slider) get\_slider [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) id string control id #### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#returns-3) Returns: [Value](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) slider [slider](https://golua.fatality.win/documentation/datatypes/slider) ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#combobox) combobox [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) id string new id container\_id string container id label string label is\_multi boolean true if combobox should enable multiselect values string... items #### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#returns-4) Returns: [Value](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) combobox [combobox](https://golua.fatality.win/documentation/datatypes/combobox) ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#get_combobox) get\_combobox [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) id string control id #### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#returns-5) Returns: [Value](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) combobox [combobox](https://golua.fatality.win/documentation/datatypes/combobox) ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#list) list [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) [Default value](https://golua.fatality.win/documentation/namespaces/gui) id string new id ❌ container\_id string container id ❌ label string label ❌ is\_mult boolean true if list should enable multiselect ❌ height number element height 120 #### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#returns-6) Returns: [Value](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) list [list](https://golua.fatality.win/documentation/datatypes/list) ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#button) button [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) id string new id container\_id string container id label string label #### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#returns-7) Returns: [Value](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) button [control](https://golua.fatality.win/documentation/datatypes/control) ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#label) label [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) id string new id container\_id string container id label string label #### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#returns-8) Returns: [Value](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) label [control](https://golua.fatality.win/documentation/datatypes/control) ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#textbox) textbox [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) id string new id container\_id string container id #### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#returns-9) Returns: [Value](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) textbox [textbox](https://golua.fatality.win/documentation/datatypes/textbox) ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#colorpicker) colorpicker [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) [Default value](https://golua.fatality.win/documentation/namespaces/gui) id string new id ❌ container\_id string container id ❌ label string label ❌ default [render.color](https://golua.fatality.win/documentation/namespaces/render#color) default color ❌ allow\_alpha boolean true if alpha modification is allowed true #### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#returns-10) Returns: [Value](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) list [list](https://golua.fatality.win/documentation/datatypes/list) ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#get_colorpicker) get\_colorpicker [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) id string control id #### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#returns-11) Returns: [Value](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) color\_picker [color\_picker](https://golua.fatality.win/documentation/datatypes/color_picker) [hashtag](https://golua.fatality.win/documentation/namespaces/gui#misc) Misc --------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#is_menu_open) is\_menu\_open #### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#returns-12) Returns: [Value](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) menu's visibility state boolean ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#get_menu_rect) get\_menu\_rect #### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#returns-13) Returns: [Value](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) x1 number y1 number x2 number y2 number ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#show_message) show\_message [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) id string messagebox id title string title message string message ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#show_message-1) show\_dialog [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) id string dialog id title string title message string message button [Enum](https://golua.fatality.win/documentation/namespaces/gui#dialog-buttons) dialog box buttons callback function([Enum](https://golua.fatality.win/documentation/namespaces/gui#dialog-result) ) result callback ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#show_message-2) add\_notification [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) title string title message string message ### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#for_each_hotkey) for\_each\_hotkey [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) fn function(string, number, number, bool) callback function #### [hashtag](https://golua.fatality.win/documentation/namespaces/gui#callback-parameters) Callback parameters: [Parameter](https://golua.fatality.win/documentation/namespaces/gui) [Datatype](https://golua.fatality.win/documentation/namespaces/gui) [Description](https://golua.fatality.win/documentation/namespaces/gui) name string item name key number active key ([keycodearrow-up-right](https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes) ) mode [Enum](https://golua.fatality.win/documentation/namespaces/gui#hotkey-modes) hotkey mode is\_active boolean true if currently active [PreviousNamespaceschevron-left](https://golua.fatality.win/documentation/namespaces) [NextRenderchevron-right](https://golua.fatality.win/documentation/namespaces/render) Last updated 2 years ago * [Enums](https://golua.fatality.win/documentation/namespaces/gui#enums) * [Controls](https://golua.fatality.win/documentation/namespaces/gui#controls) * [checkbox](https://golua.fatality.win/documentation/namespaces/gui#checkbox) * [get\_checkbox](https://golua.fatality.win/documentation/namespaces/gui#get_checkbox) * [slider](https://golua.fatality.win/documentation/namespaces/gui#slider) * [get\_slider](https://golua.fatality.win/documentation/namespaces/gui#get_slider) * [combobox](https://golua.fatality.win/documentation/namespaces/gui#combobox) * [get\_combobox](https://golua.fatality.win/documentation/namespaces/gui#get_combobox) * [list](https://golua.fatality.win/documentation/namespaces/gui#list) * [button](https://golua.fatality.win/documentation/namespaces/gui#button) * [label](https://golua.fatality.win/documentation/namespaces/gui#label) * [textbox](https://golua.fatality.win/documentation/namespaces/gui#textbox) * [colorpicker](https://golua.fatality.win/documentation/namespaces/gui#colorpicker) * [get\_colorpicker](https://golua.fatality.win/documentation/namespaces/gui#get_colorpicker) * [Misc](https://golua.fatality.win/documentation/namespaces/gui#misc) * [is\_menu\_open](https://golua.fatality.win/documentation/namespaces/gui#is_menu_open) * [get\_menu\_rect](https://golua.fatality.win/documentation/namespaces/gui#get_menu_rect) * [show\_message](https://golua.fatality.win/documentation/namespaces/gui#show_message) * [show\_dialog](https://golua.fatality.win/documentation/namespaces/gui#show_message-1) * [add\_notification](https://golua.fatality.win/documentation/namespaces/gui#show_message-2) * [for\_each\_hotkey](https://golua.fatality.win/documentation/namespaces/gui#for_each_hotkey) sun-brightdesktopmoon Copy local item = gui.checkbox('lua>elements a>test', 'lua>elements a', 'My item') Copy local item = gui.get_checkbox('lua>elements a>test') Copy local item = gui.slider('lua>elements a>test', 'lua>elements a', 'My item', 0, 100) Copy local item = gui.get_slider('lua>elements a>test') Copy local item = gui.combobox('lua>elements a>test', 'lua>elements a', true, 'My item', 'Item 1', 'Item 2', 'Item 3') Copy local item = gui.get_combobox('lua>elements a>test') Copy local item = gui.list('lua>elements a>test', 'lua>elements a', true, 60) Copy local item = gui.button('lua>elements a>test', 'lua>elements a', 'My item') Copy local item = gui.label('lua>elements a>test', 'lua>elements a', 'My item') Copy local item = gui.textbox('lua>elements a>test', 'lua>elements a') Copy local item = gui.color_picker('lua>elements a>test', 'lua>elements a', 'My item', render.color('#fff')) Copy local item = gui.get_colorpicker('lua>elements a>test') Copy gui.is_menu_open() Copy gui.get_menu_rect() Copy gui.show_message('my_message', 'Hello!', 'Click OK to close this message.') Copy gui.show_dialog('my_dialog', 'Hello!', 'Do you like balls?', gui.dialog_buttons_yes_no, function (res) if res == gui.dialog_result_affirmative then gui.show_message('my_message', 'Hey!', 'Me too'); else gui.show_message('my_message', ':(', 'Ligma'); end end); Copy gui.add_notification('Hello', 'This lua was loaded!') Copy gui.for_each_hotkey(function (name, key, mode, is_active) print('Hotkey ' .. name .. ':'); print('\tkey = ' .. tostring(key)); print('\tmode = ' .. tostring(mode)); print('\tis_active = ' .. tostring(is_active)); end); sun-brightdesktopmoon --- # Zip | Lua API [hashtag](https://golua.fatality.win/documentation/namespaces/zip#functions) Functions ------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/zip#create) create Copy zip.create() #### [hashtag](https://golua.fatality.win/documentation/namespaces/zip#returns) Returns: [Value](https://golua.fatality.win/documentation/namespaces/zip) [Datatype](https://golua.fatality.win/documentation/namespaces/zip) zip object [zip](https://golua.fatality.win/documentation/datatypes/zip) ### [hashtag](https://golua.fatality.win/documentation/namespaces/zip#open) open Copy zip.open("some_directory") [Parameter](https://golua.fatality.win/documentation/namespaces/zip) [Datatype](https://golua.fatality.win/documentation/namespaces/zip) [Description](https://golua.fatality.win/documentation/namespaces/zip) path string path to directory #### [hashtag](https://golua.fatality.win/documentation/namespaces/zip#returns-1) Returns: [Value](https://golua.fatality.win/documentation/namespaces/zip) [Datatype](https://golua.fatality.win/documentation/namespaces/zip) zip object [zip](https://golua.fatality.win/documentation/datatypes/zip) ### [hashtag](https://golua.fatality.win/documentation/namespaces/zip#open_stream) open\_stream Copy zip.open_stream(...) [Parameter](https://golua.fatality.win/documentation/namespaces/zip) [Datatype](https://golua.fatality.win/documentation/namespaces/zip) [Description](https://golua.fatality.win/documentation/namespaces/zip) stream table of char zip stream #### [hashtag](https://golua.fatality.win/documentation/namespaces/zip#returns-2) Returns: [Value](https://golua.fatality.win/documentation/namespaces/zip) [Datatype](https://golua.fatality.win/documentation/namespaces/zip) zip object [zip](https://golua.fatality.win/documentation/datatypes/zip) [PreviousFilesystemchevron-left](https://golua.fatality.win/documentation/namespaces/filesystem) [NextInstanceschevron-right](https://golua.fatality.win/documentation/instances) Last updated 3 years ago * [Functions](https://golua.fatality.win/documentation/namespaces/zip#functions) * [create](https://golua.fatality.win/documentation/namespaces/zip#create) * [open](https://golua.fatality.win/documentation/namespaces/zip#open) * [open\_stream](https://golua.fatality.win/documentation/namespaces/zip#open_stream) sun-brightdesktopmoon sun-brightdesktopmoon --- # Filesystem | Lua API [hashtag](https://golua.fatality.win/documentation/namespaces/filesystem#functions) Functions -------------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/filesystem#read) read Copy fs.read("some_file.txt") [Parameter](https://golua.fatality.win/documentation/namespaces/filesystem) [Datatype](https://golua.fatality.win/documentation/namespaces/filesystem) [Description](https://golua.fatality.win/documentation/namespaces/filesystem) path string path to file #### [hashtag](https://golua.fatality.win/documentation/namespaces/filesystem#returns) Returns: [Value](https://golua.fatality.win/documentation/namespaces/filesystem) [Datatype](https://golua.fatality.win/documentation/namespaces/filesystem) data string ### [hashtag](https://golua.fatality.win/documentation/namespaces/filesystem#read_stream) read\_stream Copy fs.read_stream("some_file.txt") [Parameter](https://golua.fatality.win/documentation/namespaces/filesystem) [Datatype](https://golua.fatality.win/documentation/namespaces/filesystem) [Description](https://golua.fatality.win/documentation/namespaces/filesystem) path string path to file #### [hashtag](https://golua.fatality.win/documentation/namespaces/filesystem#returns-1) Returns: [Value](https://golua.fatality.win/documentation/namespaces/filesystem) [Datatype](https://golua.fatality.win/documentation/namespaces/filesystem) data table of char ### [hashtag](https://golua.fatality.win/documentation/namespaces/filesystem#write) write [Parameter](https://golua.fatality.win/documentation/namespaces/filesystem) [Datatype](https://golua.fatality.win/documentation/namespaces/filesystem) [Description](https://golua.fatality.win/documentation/namespaces/filesystem) path string path to file data string data to write to file ### [hashtag](https://golua.fatality.win/documentation/namespaces/filesystem#write_stream) write\_stream [Parameter](https://golua.fatality.win/documentation/namespaces/filesystem) [Datatype](https://golua.fatality.win/documentation/namespaces/filesystem) [Description](https://golua.fatality.win/documentation/namespaces/filesystem) path string path to file data table of char data in bytes to write to file ### [hashtag](https://golua.fatality.win/documentation/namespaces/filesystem#remove) remove [Parameter](https://golua.fatality.win/documentation/namespaces/filesystem) [Datatype](https://golua.fatality.win/documentation/namespaces/filesystem) [Description](https://golua.fatality.win/documentation/namespaces/filesystem) path string path to file ### [hashtag](https://golua.fatality.win/documentation/namespaces/filesystem#exists) exists [Parameter](https://golua.fatality.win/documentation/namespaces/filesystem) [Datatype](https://golua.fatality.win/documentation/namespaces/filesystem) [Description](https://golua.fatality.win/documentation/namespaces/filesystem) path string path to file or directory #### [hashtag](https://golua.fatality.win/documentation/namespaces/filesystem#returns-2) Returns: [Value](https://golua.fatality.win/documentation/namespaces/filesystem) [Datatype](https://golua.fatality.win/documentation/namespaces/filesystem) true if file exists boolean ### [hashtag](https://golua.fatality.win/documentation/namespaces/filesystem#is_file) is\_file [Parameter](https://golua.fatality.win/documentation/namespaces/filesystem) [Datatype](https://golua.fatality.win/documentation/namespaces/filesystem) [Description](https://golua.fatality.win/documentation/namespaces/filesystem) path string path to file #### [hashtag](https://golua.fatality.win/documentation/namespaces/filesystem#returns-3) Returns: [Value](https://golua.fatality.win/documentation/namespaces/filesystem) [Datatype](https://golua.fatality.win/documentation/namespaces/filesystem) true if path leads to a file boolean ### [hashtag](https://golua.fatality.win/documentation/namespaces/filesystem#is_dir) is\_dir [Parameter](https://golua.fatality.win/documentation/namespaces/filesystem) [Datatype](https://golua.fatality.win/documentation/namespaces/filesystem) [Description](https://golua.fatality.win/documentation/namespaces/filesystem) path string path to directory #### [hashtag](https://golua.fatality.win/documentation/namespaces/filesystem#returns-4) Returns: [Value](https://golua.fatality.win/documentation/namespaces/filesystem) [Datatype](https://golua.fatality.win/documentation/namespaces/filesystem) true if path leads to a directory boolean ### [hashtag](https://golua.fatality.win/documentation/namespaces/filesystem#create_dir) create\_dir [Parameter](https://golua.fatality.win/documentation/namespaces/filesystem) [Datatype](https://golua.fatality.win/documentation/namespaces/filesystem) [Description](https://golua.fatality.win/documentation/namespaces/filesystem) path string path to directory [PreviousMaterialschevron-left](https://golua.fatality.win/documentation/namespaces/materials) [NextZipchevron-right](https://golua.fatality.win/documentation/namespaces/zip) Last updated 3 years ago * [Functions](https://golua.fatality.win/documentation/namespaces/filesystem#functions) * [read](https://golua.fatality.win/documentation/namespaces/filesystem#read) * [read\_stream](https://golua.fatality.win/documentation/namespaces/filesystem#read_stream) * [write](https://golua.fatality.win/documentation/namespaces/filesystem#write) * [write\_stream](https://golua.fatality.win/documentation/namespaces/filesystem#write_stream) * [remove](https://golua.fatality.win/documentation/namespaces/filesystem#remove) * [exists](https://golua.fatality.win/documentation/namespaces/filesystem#exists) * [is\_file](https://golua.fatality.win/documentation/namespaces/filesystem#is_file) * [is\_dir](https://golua.fatality.win/documentation/namespaces/filesystem#is_dir) * [create\_dir](https://golua.fatality.win/documentation/namespaces/filesystem#create_dir) sun-brightdesktopmoon Copy fs.write("some_file.txt", "data") Copy fs.write_stream("some_file.txt", {"a", "b", "c"}) Copy fs.remove("some_file.txt") Copy fs.exists("some_file.txt") Copy fs.is_file("some_file.txt") Copy fs.is_dir("some_file.txt") Copy fs.create_dir("folder/some_directory") sun-brightdesktopmoon --- # Datatypes | Lua API [🖥️controlchevron-right](https://golua.fatality.win/documentation/datatypes/control) [🖥️checkboxchevron-right](https://golua.fatality.win/documentation/datatypes/checkbox) [🖥️comboboxchevron-right](https://golua.fatality.win/documentation/datatypes/combobox) [🖥️color\_pickerchevron-right](https://golua.fatality.win/documentation/datatypes/color_picker) [🖥️sliderchevron-right](https://golua.fatality.win/documentation/datatypes/slider) [🖥️textboxchevron-right](https://golua.fatality.win/documentation/datatypes/textbox) [🖥️listchevron-right](https://golua.fatality.win/documentation/datatypes/list) [⚙️entitychevron-right](https://golua.fatality.win/documentation/datatypes/entity) [⚙️player\_infochevron-right](https://golua.fatality.win/documentation/datatypes/player_info) [⚙️weapon\_infochevron-right](https://golua.fatality.win/documentation/datatypes/weapon_info) [⚙️user\_cmdchevron-right](https://golua.fatality.win/documentation/datatypes/user_cmd) [⚙️trace\_tchevron-right](https://golua.fatality.win/documentation/datatypes/trace_t) [⚙️vec3chevron-right](https://golua.fatality.win/documentation/datatypes/vec3) [⚙️timerchevron-right](https://golua.fatality.win/documentation/datatypes/timer) [⚙️cvarchevron-right](https://golua.fatality.win/documentation/datatypes/cvar) [⚙️shot\_infochevron-right](https://golua.fatality.win/documentation/datatypes/shot_info) [⚙️game\_eventchevron-right](https://golua.fatality.win/documentation/datatypes/game_event) [⚙️materialchevron-right](https://golua.fatality.win/documentation/datatypes/material) [⚙️material\_varchevron-right](https://golua.fatality.win/documentation/datatypes/material_var) [⚙️zipchevron-right](https://golua.fatality.win/documentation/datatypes/zip) [⚙️animatorchevron-right](https://golua.fatality.win/documentation/datatypes/animator) [PreviousServerchevron-left](https://golua.fatality.win/documentation/instances/server) [Nextcontrolchevron-right](https://golua.fatality.win/documentation/datatypes/control) Last updated 2 years ago sun-brightdesktopmoon sun-brightdesktopmoon --- # combobox | Lua API circle-info Inherits all [control](https://golua.fatality.win/documentation/datatypes/control) functions [hashtag](https://golua.fatality.win/documentation/datatypes/combobox#functions) Functions ----------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/combobox#get) get Copy local item = gui.combobox('lua>elements a>test', 'lua>elements a', 'Test combobox', false, 'Value 1', 'Value 2') print(item:get()); #### [hashtag](https://golua.fatality.win/documentation/datatypes/combobox#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) value string ### [hashtag](https://golua.fatality.win/documentation/datatypes/combobox#set) set Copy local item = gui.combobox('lua>elements a>test', 'lua>elements a', 'Test combobox', false, 'Value 1', 'Value 2') iteam:set(10) [Parameter](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) [Description](https://golua.fatality.win/documentation/datatypes/control) value string new value [Previouscheckboxchevron-left](https://golua.fatality.win/documentation/datatypes/checkbox) [Nextcolor\_pickerchevron-right](https://golua.fatality.win/documentation/datatypes/color_picker) Last updated 2 years ago * [Functions](https://golua.fatality.win/documentation/datatypes/combobox#functions) * [get](https://golua.fatality.win/documentation/datatypes/combobox#get) * [set](https://golua.fatality.win/documentation/datatypes/combobox#set) sun-brightdesktopmoon sun-brightdesktopmoon --- # checkbox | Lua API circle-info Inherits all [control](https://golua.fatality.win/documentation/datatypes/control) functions [hashtag](https://golua.fatality.win/documentation/datatypes/checkbox#functions) Functions ----------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/checkbox#get) get Copy local item = gui.checkbox('lua>elements a>test', 'lua>elements a', 'Test checkbox') print(item:get()); #### [hashtag](https://golua.fatality.win/documentation/datatypes/checkbox#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) value boolean ### [hashtag](https://golua.fatality.win/documentation/datatypes/checkbox#set) set Copy local item = gui.checkbox('lua>elements a>test', 'lua>elements a', 'Test checkbox') iteam:set(true) [Parameter](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) [Description](https://golua.fatality.win/documentation/datatypes/control) value boolean new value [Previouscontrolchevron-left](https://golua.fatality.win/documentation/datatypes/control) [Nextcomboboxchevron-right](https://golua.fatality.win/documentation/datatypes/combobox) Last updated 2 years ago * [Functions](https://golua.fatality.win/documentation/datatypes/checkbox#functions) * [get](https://golua.fatality.win/documentation/datatypes/checkbox#get) * [set](https://golua.fatality.win/documentation/datatypes/checkbox#set) sun-brightdesktopmoon sun-brightdesktopmoon --- # textbox | Lua API circle-info Inherits all [control](https://golua.fatality.win/documentation/datatypes/control) functions [hashtag](https://golua.fatality.win/documentation/datatypes/textbox#functions) Functions ---------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/textbox#get) get Copy local item = gui.textbox('lua>elements a>test', 'lua>elements a') print(item:get()); #### [hashtag](https://golua.fatality.win/documentation/datatypes/textbox#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) value string ### [hashtag](https://golua.fatality.win/documentation/datatypes/textbox#set) set Copy local item = gui.textbox('lua>elements a>test', 'lua>elements a') iteam:set("Text") [Parameter](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) [Description](https://golua.fatality.win/documentation/datatypes/control) value string new value [Previoussliderchevron-left](https://golua.fatality.win/documentation/datatypes/slider) [Nextlistchevron-right](https://golua.fatality.win/documentation/datatypes/list) Last updated 2 years ago * [Functions](https://golua.fatality.win/documentation/datatypes/textbox#functions) * [get](https://golua.fatality.win/documentation/datatypes/textbox#get) * [set](https://golua.fatality.win/documentation/datatypes/textbox#set) sun-brightdesktopmoon sun-brightdesktopmoon --- # player_info | Lua API [Variable name](https://golua.fatality.win/documentation/datatypes/player_info) [Datatype](https://golua.fatality.win/documentation/datatypes/player_info) [Description](https://golua.fatality.win/documentation/datatypes/player_info) name string player's name steam\_id string players steam id steam\_id64 string players steam 64 id user\_id number player's user id steam\_id64\_high number upper bytes of the player's steam 64 id steam\_id64\_low number lower bytes of the player's steam 64 id [Previousentitychevron-left](https://golua.fatality.win/documentation/datatypes/entity) [Nextweapon\_infochevron-right](https://golua.fatality.win/documentation/datatypes/weapon_info) Last updated 3 years ago sun-brightdesktopmoon sun-brightdesktopmoon --- # control | Lua API circle-info The following functions can be used for all gui types. [hashtag](https://golua.fatality.win/documentation/datatypes/control#functions) Functions ---------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/control#set_tooltip) set\_tooltip Copy local item = gui.combobox('lua>elements a>test', 'lua>elements a', 'Test combobox', false, 'Value 1', 'Value 2') item:set_tooltip("This is a combobox") [Parameter](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) [Description](https://golua.fatality.win/documentation/datatypes/control) tooltip string tooltip text ### [hashtag](https://golua.fatality.win/documentation/datatypes/control#set_visible) set\_visible Copy local item = gui.checkbox('lua>elements a>test', 'lua>elements a', 'Test checkbox') iteam:set_visible(false) [Parameter](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) [Description](https://golua.fatality.win/documentation/datatypes/control) value boolean new visibility ### [hashtag](https://golua.fatality.win/documentation/datatypes/control#add_callback) add\_callback Copy local item = gui.slider('lua>elements a>test', 'lua>elements a', 'Test slider', 0, 10) iteam:add_callback(function() print(item:get()) end) [Parameter](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) [Description](https://golua.fatality.win/documentation/datatypes/control) callback function() callback function ### [hashtag](https://golua.fatality.win/documentation/datatypes/control#get_name) get\_name #### [hashtag](https://golua.fatality.win/documentation/datatypes/control#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) name string ### [hashtag](https://golua.fatality.win/documentation/datatypes/control#get_type) get\_type #### [hashtag](https://golua.fatality.win/documentation/datatypes/control#returns-1) Returns: [Value](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) type string [PreviousDatatypeschevron-left](https://golua.fatality.win/documentation/datatypes) [Nextcheckboxchevron-right](https://golua.fatality.win/documentation/datatypes/checkbox) Last updated 2 years ago * [Functions](https://golua.fatality.win/documentation/datatypes/control#functions) * [set\_tooltip](https://golua.fatality.win/documentation/datatypes/control#set_tooltip) * [set\_visible](https://golua.fatality.win/documentation/datatypes/control#set_visible) * [add\_callback](https://golua.fatality.win/documentation/datatypes/control#add_callback) * [get\_name](https://golua.fatality.win/documentation/datatypes/control#get_name) * [get\_type](https://golua.fatality.win/documentation/datatypes/control#get_type) sun-brightdesktopmoon Copy local item = gui.textbox('lua>elements a>test', 'lua>elements a') print(iteam:get_name()) -- prints 'textbox' Copy local item = gui.color_picker('lua>elements a>test', 'lua>elements a', 'Test color picker', render.color('#fff')) print(iteam:get_type()) -- prints 'color_picker' sun-brightdesktopmoon --- # timer | Lua API [hashtag](https://golua.fatality.win/documentation/datatypes/timer#functions) Functions -------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/timer#start) start Copy local timer = utils.new_timer(100, function() print("This will be printed every 100ms") end) timer:start() #### [hashtag](https://golua.fatality.win/documentation/datatypes/timer#usage) Usage: Begins the timer. ### [hashtag](https://golua.fatality.win/documentation/datatypes/timer#stop) stop Copy timer:stop() #### [hashtag](https://golua.fatality.win/documentation/datatypes/timer#usage-1) Usage: Pauses the timer. ### [hashtag](https://golua.fatality.win/documentation/datatypes/timer#run_once) run\_once Copy local timer = utils.new_timer(100, function() print("This will be printed once") end) timer:run_once() #### [hashtag](https://golua.fatality.win/documentation/datatypes/timer#usage-2) Usage: Run a timer once. ### [hashtag](https://golua.fatality.win/documentation/datatypes/timer#is_active) is\_active #### [hashtag](https://golua.fatality.win/documentation/datatypes/timer#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/timer) [Datatype](https://golua.fatality.win/documentation/datatypes/timer) timer's state boolean ### [hashtag](https://golua.fatality.win/documentation/datatypes/timer#set_delay) set\_delay [Parameter](https://golua.fatality.win/documentation/datatypes/timer) [Datatype](https://golua.fatality.win/documentation/datatypes/timer) [Description](https://golua.fatality.win/documentation/datatypes/timer) delay number the amount of ms to change the timer's delay to [Previousvec3chevron-left](https://golua.fatality.win/documentation/datatypes/vec3) [Nextcvarchevron-right](https://golua.fatality.win/documentation/datatypes/cvar) Last updated 3 years ago * [Functions](https://golua.fatality.win/documentation/datatypes/timer#functions) * [start](https://golua.fatality.win/documentation/datatypes/timer#start) * [stop](https://golua.fatality.win/documentation/datatypes/timer#stop) * [run\_once](https://golua.fatality.win/documentation/datatypes/timer#run_once) * [is\_active](https://golua.fatality.win/documentation/datatypes/timer#is_active) * [set\_delay](https://golua.fatality.win/documentation/datatypes/timer#set_delay) sun-brightdesktopmoon Copy local timer_active = timer:is_active() Copy local timer = utils.new_timer(0, function() print("This will be run every 1000ms") end) timer:set_delay(1000) timer:start() sun-brightdesktopmoon --- # slider | Lua API circle-info Inherits all [control](https://golua.fatality.win/documentation/datatypes/control) functions [hashtag](https://golua.fatality.win/documentation/datatypes/slider#functions) Functions --------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/slider#get) get Copy local item = gui.slider('lua>elements a>test', 'lua>elements a', 'Test slider', -10, 10) print(item:get()); #### [hashtag](https://golua.fatality.win/documentation/datatypes/slider#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) value number ### [hashtag](https://golua.fatality.win/documentation/datatypes/slider#set) set Copy local item = gui.slider('lua>elements a>test', 'lua>elements a', 'Test slider', -10, 10) iteam:set(10) [Parameter](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) [Description](https://golua.fatality.win/documentation/datatypes/control) value number new value [Previouscolor\_pickerchevron-left](https://golua.fatality.win/documentation/datatypes/color_picker) [Nexttextboxchevron-right](https://golua.fatality.win/documentation/datatypes/textbox) Last updated 2 years ago * [Functions](https://golua.fatality.win/documentation/datatypes/slider#functions) * [get](https://golua.fatality.win/documentation/datatypes/slider#get) * [set](https://golua.fatality.win/documentation/datatypes/slider#set) sun-brightdesktopmoon sun-brightdesktopmoon --- # weapon_info | Lua API [Variable name](https://golua.fatality.win/documentation/datatypes/weapon_info) [Datatype](https://golua.fatality.win/documentation/datatypes/weapon_info) [Description](https://golua.fatality.win/documentation/datatypes/weapon_info) console\_name string weapon's console name world\_model string path to weapon's world model view\_model string path to weapon's view model is\_full\_auto boolean is the weapon fully automatic has\_silencer boolean does the weapon have a silencer max\_clip1 number the max amount of ammo that can be in the clip max\_clip2 number the max amount of reserve ammo weapon\_type number the type of weapon weapon\_price number how much the weapon cost to buy kill\_reward number how much a kill with the weapon will gain you damage number the weapon's base damage range number the weapon's max range range\_modifier number the weapon's range modifier throw\_velocity number the velocity of grenades max\_player\_speed number the max speed while running with the weapon max\_player\_speed\_alt number the max speed while walking with the weapon zoom\_levels number the number of zoom levels zoom\_fov1 number the fov of the first zoom zoom\_fov2 number the fov of the second zoom cycle\_time number the weapon's cycle time chevron-rightItem Definition Indexes[hashtag](https://golua.fatality.win/documentation/datatypes/weapon_info#item-definition-indexes) [Previousplayer\_infochevron-left](https://golua.fatality.win/documentation/datatypes/player_info) [Nextuser\_cmdchevron-right](https://golua.fatality.win/documentation/datatypes/user_cmd) Last updated 3 years ago sun-brightdesktopmoon Copy local ItemDefinitionIndexs = { WEAPON_NONE = 0, WEAPON_DEAGLE = 1, WEAPON_ELITE = 2, WEAPON_FIVESEVEN = 3, WEAPON_GLOCK = 4, WEAPON_AK47 = 7, WEAPON_AUG = 8, WEAPON_AWP = 9, WEAPON_FAMAS = 10, WEAPON_G3SG1 = 11, WEAPON_GALILAR = 13, WEAPON_M249 = 14, WEAPON_M4A1 = 16, WEAPON_MAC10 = 17, WEAPON_P90 = 19, WEAPON_MP5SD = 23, WEAPON_UMP45 = 24, WEAPON_XM1014 = 25, WEAPON_BIZON = 26, WEAPON_MAG7 = 27, WEAPON_NEGEV = 28, WEAPON_SAWEDOFF = 29, WEAPON_TEC9 = 30, WEAPON_TASER = 31, WEAPON_HKP2000 = 32, WEAPON_MP7 = 33, WEAPON_MP9 = 34, WEAPON_NOVA = 35, WEAPON_P250 = 36, WEAPON_SHIELD = 37, WEAPON_SCAR20 = 38, WEAPON_SG556 = 39, WEAPON_SSG08 = 40, WEAPON_GOLDEN_KNIFE = 41, WEAPON_KNIFE = 42, WEAPON_FLASHBANG = 43, WEAPON_HEGRENADE = 44, WEAPON_SMOKEGRENADE = 45, WEAPON_MOLOTOV = 46, WEAPON_DECOY = 47, WEAPON_INCGRENADE = 48, WEAPON_C4 = 49, WEAPON_HEALTHSHOT = 57, WEAPON_KNIFE_T = 59, WEAPON_M4A1_SILENCER = 60, WEAPON_USP_SILENCER = 61, WEAPON_CZ75A = 63, WEAPON_REVOLVER = 64, WEAPON_TAGRENADE = 68, WEAPON_FISTS = 69, WEAPON_BREACHCHARGE = 70, WEAPON_TABLET = 72, WEAPON_MELEE = 74, WEAPON_AXE = 75, WEAPON_HAMMER = 76, WEAPON_SPANNER = 78, WEAPON_KNIFE_GHOST = 80, WEAPON_DIVERSION = 82, WEAPON_FRAG_GRENADE = 83, WEAPON_SNOWBALL = 84, WEAPON_BUMPMINE = 85, WEAPON_KNIFE_BAYONET = 500, WEAPON_KNIFE_CSS = 503, WEAPON_KNIFE_FLIP = 505, WEAPON_KNIFE_GUT = 506, WEAPON_KNIFE_KARAMBIT = 507, WEAPON_KNIFE_M9_BAYONET = 508, WEAPON_KNIFE_HUNTSMAN = 509, WEAPON_KNIFE_FALCHION = 512, WEAPON_KNIFE_BOWIE = 514, WEAPON_KNIFE_BUTTERFLY = 515, WEAPON_KNIFE_SHADDOWDAGGERS = 516, WEAPON_KNIFE_PARACORD = 517, WEAPON_KNIFE_SURVIVAL = 518, WEAPON_KNIFE_URSUS = 519, WEAPON_KNIFE_NAVAJA = 520, WEAPON_KNIFE_NOMAD = 521, WEAPON_KNIFE_STILETTO = 522, WEAPON_KNIFE_TALON = 523, WEAPON_KNIFE_SKELETON = 525, GLOVE_STUDDED_BLOODHOUND = 5027, GLOVE_T_SIDE = 5028, GLOVE_CT_SIDE = 5029, GLOVE_SPORTY = 5030, GLOVE_SLICK = 5031, GLOVE_LEATHER_WRAP = 5032, GLOVE_MOTORCYCLE = 5033, GLOVE_SPECIALIST = 5034, GLOVE_HYDRA = 5035 }; sun-brightdesktopmoon --- # color_picker | Lua API circle-info Inherits all [control](https://golua.fatality.win/documentation/datatypes/control) functions [hashtag](https://golua.fatality.win/documentation/datatypes/color_picker#functions) Functions --------------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/color_picker#get) get Copy local item = gui.color_picker('lua>elements a>test', 'lua>elements a', 'Test colorpicker', render.color('#fff')) print(item:get()); #### [hashtag](https://golua.fatality.win/documentation/datatypes/color_picker#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) value [color](https://golua.fatality.win/documentation/namespaces/render#color) ### [hashtag](https://golua.fatality.win/documentation/datatypes/color_picker#set) set Copy local item = gui.color_picker('lua>elements a>test', 'lua>elements a', 'Test colorpicker', render.color('fff')) iteam:set(render.color('#000')) [Parameter](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) [Description](https://golua.fatality.win/documentation/datatypes/control) value [color](https://golua.fatality.win/documentation/namespaces/render#color) new value [Previouscomboboxchevron-left](https://golua.fatality.win/documentation/datatypes/combobox) [Nextsliderchevron-right](https://golua.fatality.win/documentation/datatypes/slider) Last updated 2 years ago * [Functions](https://golua.fatality.win/documentation/datatypes/color_picker#functions) * [get](https://golua.fatality.win/documentation/datatypes/color_picker#get) * [set](https://golua.fatality.win/documentation/datatypes/color_picker#set) sun-brightdesktopmoon sun-brightdesktopmoon --- # list | Lua API circle-info Inherits all [control](https://golua.fatality.win/documentation/datatypes/control) functions circle-info Multiselect lists return a table if you pass true as an argument for [**get**](https://golua.fatality.win/documentation/datatypes/list#get) and also accept a table for [**set**](https://golua.fatality.win/documentation/datatypes/list#set) [hashtag](https://golua.fatality.win/documentation/datatypes/list#functions) Functions ------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/list#get) get Copy local item = gui.list('lua>elements a>test', 'lua>elements a') item:add('Value 1') print(item:get()); #### [hashtag](https://golua.fatality.win/documentation/datatypes/list#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) value string ### [hashtag](https://golua.fatality.win/documentation/datatypes/list#set) set Copy local item = gui.list('lua>elements a>test', 'lua>elements a') item:add('Value 1') item:add('Value 2') item:set('Value 1') [Parameter](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) [Description](https://golua.fatality.win/documentation/datatypes/control) value string new value ### [hashtag](https://golua.fatality.win/documentation/datatypes/list#add) add [Parameter](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) [Description](https://golua.fatality.win/documentation/datatypes/control) value string new list item ### [hashtag](https://golua.fatality.win/documentation/datatypes/list#remove) remove [Parameter](https://golua.fatality.win/documentation/datatypes/control) [Datatype](https://golua.fatality.win/documentation/datatypes/control) [Description](https://golua.fatality.win/documentation/datatypes/control) value string item to remove [Previoustextboxchevron-left](https://golua.fatality.win/documentation/datatypes/textbox) [Nextentitychevron-right](https://golua.fatality.win/documentation/datatypes/entity) Last updated 2 years ago * [Functions](https://golua.fatality.win/documentation/datatypes/list#functions) * [get](https://golua.fatality.win/documentation/datatypes/list#get) * [set](https://golua.fatality.win/documentation/datatypes/list#set) * [add](https://golua.fatality.win/documentation/datatypes/list#add) * [remove](https://golua.fatality.win/documentation/datatypes/list#remove) sun-brightdesktopmoon Copy local item = gui.list('lua>elements a>test', 'lua>elements a') item:add('Value 1') item:add('Value 2') Copy local item = gui.list('lua>elements a>test', 'lua>elements a') item:add('Value 1') item:add('Value 2') item:remove('Value 1') sun-brightdesktopmoon --- # trace_t | Lua API [Variable name](https://golua.fatality.win/documentation/datatypes/trace_t) [Datatype](https://golua.fatality.win/documentation/datatypes/trace_t) [Description](https://golua.fatality.win/documentation/datatypes/trace_t) endpos [math.vec3](https://golua.fatality.win/documentation/datatypes/vec3) the end position fraction float percentage of the path the trace went (0 - 1) ent\_index number index of impacted entity if any hitbox number impacted hitbox if any hitgroup number impacted hitgroup if any plane\_normal math.vec3 surface plane's normal vector plane\_dist float plane distancecontents allsolid boolean if true then the plane is not valid startsolid boolean if true then the initial point was in a solid area fractionleftsolid float time left a solid, only valid if started in solid contents number \- disp\_flags number \- weapon\_type number the type of weapon surface\_name string \- surface\_props number \- surface\_flags number \- [Previoususer\_cmdchevron-left](https://golua.fatality.win/documentation/datatypes/user_cmd) [Nextvec3chevron-right](https://golua.fatality.win/documentation/datatypes/vec3) Last updated 3 years ago sun-brightdesktopmoon sun-brightdesktopmoon --- # cvar | Lua API [hashtag](https://golua.fatality.win/documentation/datatypes/cvar#functions) Functions ------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/cvar#get_int) get\_int Copy local var = cvar.sv_cheats print(var:get_int()) #### [hashtag](https://golua.fatality.win/documentation/datatypes/cvar#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/cvar) [Datatype](https://golua.fatality.win/documentation/datatypes/cvar) cvar's value as an integer number ### [hashtag](https://golua.fatality.win/documentation/datatypes/cvar#get_float) get\_float Copy local var = cvar.weapon_recoil_scale print(var:get_float()) #### [hashtag](https://golua.fatality.win/documentation/datatypes/cvar#returns-1) Returns: [Value](https://golua.fatality.win/documentation/datatypes/cvar) [Datatype](https://golua.fatality.win/documentation/datatypes/cvar) cvar's value as a float number ### [hashtag](https://golua.fatality.win/documentation/datatypes/cvar#get_string) get\_string Copy local var = cvar.sv_skyname print(var:get_string()) #### [hashtag](https://golua.fatality.win/documentation/datatypes/cvar#returns-2) Returns: [Value](https://golua.fatality.win/documentation/datatypes/cvar) [Datatype](https://golua.fatality.win/documentation/datatypes/cvar) cvar's value as a string string ### [hashtag](https://golua.fatality.win/documentation/datatypes/cvar#set_int) set\_int [Parameter](https://golua.fatality.win/documentation/datatypes/cvar) [Datatype](https://golua.fatality.win/documentation/datatypes/cvar) [Description](https://golua.fatality.win/documentation/datatypes/cvar) value number integer value to set cvar to ### [hashtag](https://golua.fatality.win/documentation/datatypes/cvar#set_float) set\_float [Parameter](https://golua.fatality.win/documentation/datatypes/cvar) [Datatype](https://golua.fatality.win/documentation/datatypes/cvar) [Description](https://golua.fatality.win/documentation/datatypes/cvar) value number floating point value to set cvar to ### [hashtag](https://golua.fatality.win/documentation/datatypes/cvar#set_string) set\_string [Parameter](https://golua.fatality.win/documentation/datatypes/cvar) [Datatype](https://golua.fatality.win/documentation/datatypes/cvar) [Description](https://golua.fatality.win/documentation/datatypes/cvar) value string string value to set cvar to [Previoustimerchevron-left](https://golua.fatality.win/documentation/datatypes/timer) [Nextshot\_infochevron-right](https://golua.fatality.win/documentation/datatypes/shot_info) Last updated 3 years ago * [Functions](https://golua.fatality.win/documentation/datatypes/cvar#functions) * [get\_int](https://golua.fatality.win/documentation/datatypes/cvar#get_int) * [get\_float](https://golua.fatality.win/documentation/datatypes/cvar#get_float) * [get\_string](https://golua.fatality.win/documentation/datatypes/cvar#get_string) * [set\_int](https://golua.fatality.win/documentation/datatypes/cvar#set_int) * [set\_float](https://golua.fatality.win/documentation/datatypes/cvar#set_float) * [set\_string](https://golua.fatality.win/documentation/datatypes/cvar#set_string) sun-brightdesktopmoon Copy local var = cvar.sv_cheats var:set_int(1) Copy local var = cvar.weapon_recoil_scale var:set_float(0) Copy local var = cvar.sv_skyname var:set_string("vertigo") sun-brightdesktopmoon --- # user_cmd | Lua API [hashtag](https://golua.fatality.win/documentation/datatypes/user_cmd#enums) Enums --------------------------------------------------------------------------------------- chevron-rightButtons[hashtag](https://golua.fatality.win/documentation/datatypes/user_cmd#buttons) * in\_attack * in\_attack2 * in\_jump * in\_duck * in\_forward * in\_back * in\_use * in\_left * in\_right * in\_move\_left * in\_move\_right * in\_score [hashtag](https://golua.fatality.win/documentation/datatypes/user_cmd#functions) Functions ----------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/user_cmd#get_command_number) get\_command\_number Copy local cmd_number = user_cmd:get_command_number() #### [hashtag](https://golua.fatality.win/documentation/datatypes/user_cmd#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/user_cmd) [Datatype](https://golua.fatality.win/documentation/datatypes/user_cmd) command\_number number ### [hashtag](https://golua.fatality.win/documentation/datatypes/user_cmd#get_view_angles) get\_view\_angles Copy local view_angles = user_cmd:get_view_angles() #### [hashtag](https://golua.fatality.win/documentation/datatypes/user_cmd#returns-1) Returns: [Value](https://golua.fatality.win/documentation/datatypes/user_cmd) [Datatype](https://golua.fatality.win/documentation/datatypes/user_cmd) pitch number yaw number ### [hashtag](https://golua.fatality.win/documentation/datatypes/user_cmd#set_view_angles) set\_view\_angles [Parameter](https://golua.fatality.win/documentation/datatypes/user_cmd) [Datatype](https://golua.fatality.win/documentation/datatypes/user_cmd) pitch number yaw number roll number ### [hashtag](https://golua.fatality.win/documentation/datatypes/user_cmd#get_move) get\_move #### [hashtag](https://golua.fatality.win/documentation/datatypes/user_cmd#returns-2) Returns: [Value](https://golua.fatality.win/documentation/datatypes/user_cmd) [Datatype](https://golua.fatality.win/documentation/datatypes/user_cmd) forward\_move number side\_move number ### [hashtag](https://golua.fatality.win/documentation/datatypes/user_cmd#set_move) set\_move [Parameter](https://golua.fatality.win/documentation/datatypes/user_cmd) [Datatype](https://golua.fatality.win/documentation/datatypes/user_cmd) [Description](https://golua.fatality.win/documentation/datatypes/user_cmd) forward\_move number forward move value (-450 - 450) side\_move number side move value (-450 - 450) ### [hashtag](https://golua.fatality.win/documentation/datatypes/user_cmd#get_buttons) get\_buttons [Value](https://golua.fatality.win/documentation/datatypes/user_cmd) [Datatype](https://golua.fatality.win/documentation/datatypes/user_cmd) buttons number ### [hashtag](https://golua.fatality.win/documentation/datatypes/user_cmd#set_buttons) set\_buttons [Parameter](https://golua.fatality.win/documentation/datatypes/user_cmd) [Datatype](https://golua.fatality.win/documentation/datatypes/user_cmd) [Description](https://golua.fatality.win/documentation/datatypes/user_cmd) buttons [csgo.button](https://golua.fatality.win/documentation/datatypes/user_cmd#enums) button flags [hashtag](https://golua.fatality.win/documentation/datatypes/user_cmd#extra) Extra --------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/user_cmd#get-set-specific-button-flags) Get / Set specific button flags circle-exclamation Make sure you have [bit.bset](https://golua.fatality.win/getting-started/useful-resources#setting-specific-bits) defined! [Previousweapon\_infochevron-left](https://golua.fatality.win/documentation/datatypes/weapon_info) [Nexttrace\_tchevron-right](https://golua.fatality.win/documentation/datatypes/trace_t) Last updated 3 years ago * [Enums](https://golua.fatality.win/documentation/datatypes/user_cmd#enums) * [Functions](https://golua.fatality.win/documentation/datatypes/user_cmd#functions) * [get\_command\_number](https://golua.fatality.win/documentation/datatypes/user_cmd#get_command_number) * [get\_view\_angles](https://golua.fatality.win/documentation/datatypes/user_cmd#get_view_angles) * [set\_view\_angles](https://golua.fatality.win/documentation/datatypes/user_cmd#set_view_angles) * [get\_move](https://golua.fatality.win/documentation/datatypes/user_cmd#get_move) * [set\_move](https://golua.fatality.win/documentation/datatypes/user_cmd#set_move) * [get\_buttons](https://golua.fatality.win/documentation/datatypes/user_cmd#get_buttons) * [set\_buttons](https://golua.fatality.win/documentation/datatypes/user_cmd#set_buttons) * [Extra](https://golua.fatality.win/documentation/datatypes/user_cmd#extra) * [Get / Set specific button flags](https://golua.fatality.win/documentation/datatypes/user_cmd#get-set-specific-button-flags) sun-brightdesktopmoon Copy user_cmd:set_view_angles(0, 90, 0) Copy local move = user_cmd:get_move() Copy user_cmd:set_move(450, 0) Copy local buttons = user_cmd:get_buttons() Copy user_cmd:set_buttons(utils.flags(user_cmd:get_buttons(), csgo.in_jump, csgo.in_duck)) Copy local function GetButton(cmd, button) return bit.band(cmd:get_buttons(), button) ~= 0 end local function SetButton(cmd, button, value) cmd:set_buttons(bit.bset(cmd:get_buttons(), math.log(button, 2), tonumber(value))) end -- Example usage function on_setup_move(cmd) -- Returns true if the in_attack flag is set to 1 local attacking = GetButton(cmd, csgo.in_attack) -- Sets the in_attack flag to 1 SetButton(cmd, csgo.in_attack, true) end sun-brightdesktopmoon --- # animator | Lua API [hashtag](https://golua.fatality.win/documentation/datatypes/animator#functions) Functions ----------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/animator#direct) direct Copy local animator = render.create_animator_float(0, 5, render.ease_in) -- animator:direct(to) animator:direct(1) -- animator:direct(from, to) animator:direct(0, 100) [Parameter](https://golua.fatality.win/documentation/datatypes/animator) [Datatype](https://golua.fatality.win/documentation/datatypes/animator) [Description](https://golua.fatality.win/documentation/datatypes/animator) [Default value](https://golua.fatality.win/documentation/datatypes/animator) to number or [color](https://golua.fatality.win/documentation/namespaces/render#color) ending value ❌ from number or [color](https://golua.fatality.win/documentation/namespaces/render#color) starting value current animator value ### [hashtag](https://golua.fatality.win/documentation/datatypes/animator#get_value) get\_value Copy local animator = render.create_animator_float(render.color("FFFFFF"), render.ease_in) animator:get_value() #### [hashtag](https://golua.fatality.win/documentation/datatypes/animator#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/animator) [Datatype](https://golua.fatality.win/documentation/datatypes/animator) animators current value number or [color](https://golua.fatality.win/documentation/namespaces/render#color) [Previouszipchevron-left](https://golua.fatality.win/documentation/datatypes/zip) Last updated 3 years ago * [Functions](https://golua.fatality.win/documentation/datatypes/animator#functions) * [direct](https://golua.fatality.win/documentation/datatypes/animator#direct) * [get\_value](https://golua.fatality.win/documentation/datatypes/animator#get_value) sun-brightdesktopmoon sun-brightdesktopmoon --- # shot_info | Lua API chevron-rightShot results[hashtag](https://golua.fatality.win/documentation/datatypes/shot_info#shot-results) * hit * spread * resolve * server correction * extrapolation * anti-exploit [Variable name](https://golua.fatality.win/documentation/datatypes/shot_info) [Datatype](https://golua.fatality.win/documentation/datatypes/shot_info) [Description](https://golua.fatality.win/documentation/datatypes/shot_info) manual boolean was it the user that fired secure boolean was a safe point targeted very\_secure boolean was a safe point targeted with roll respected result string the shots result target number targeted player index -1 if shot was manually fired tick number tick the shot was fired at backtrack number number of ticks backtracked hitchance number the chance of the shot hitting (0 - 100) client\_hitgroup number the targeted hitgroup client\_damage number the targeted damage server\_hitgroup number the registered hitgroup or 0 if the shot missed server\_damage number the registered damage or 0 if the shot missed client\_impacts table of [math.vec3](https://golua.fatality.win/documentation/datatypes/vec3) table of client side impacts server\_impacts table of [math.vec3](https://golua.fatality.win/documentation/datatypes/vec3) table of server side impacts server\_hitpos [math.vec3](https://golua.fatality.win/documentation/namespaces/math#vec3) the hit position on the server. vec3(0, 0, 0) if miss client\_hitpos [math.vec3](https://golua.fatality.win/documentation/namespaces/math#vec3) the hit position on the client shotpos [math.vec3](https://golua.fatality.win/documentation/namespaces/math#vec3) where the bullet originated from [Previouscvarchevron-left](https://golua.fatality.win/documentation/datatypes/cvar) [Nextgame\_eventchevron-right](https://golua.fatality.win/documentation/datatypes/game_event) Last updated 3 years ago sun-brightdesktopmoon sun-brightdesktopmoon --- # material_var | Lua API [hashtag](https://golua.fatality.win/documentation/datatypes/material_var#functions) Functions --------------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/material_var#get_int) get\_int Copy material_var:get_int() #### [hashtag](https://golua.fatality.win/documentation/datatypes/material_var#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/material_var) [Datatype](https://golua.fatality.win/documentation/datatypes/material_var) material var as an integer number ### [hashtag](https://golua.fatality.win/documentation/datatypes/material_var#set_int) set\_int Copy material_var:set_int(1) [Parameter](https://golua.fatality.win/documentation/datatypes/material_var) [Datatype](https://golua.fatality.win/documentation/datatypes/material_var) [Description](https://golua.fatality.win/documentation/datatypes/material_var) value number integer value to set var to ### [hashtag](https://golua.fatality.win/documentation/datatypes/material_var#get_float) get\_float Copy material_var:get_float() #### [hashtag](https://golua.fatality.win/documentation/datatypes/material_var#returns-1) Returns: [Value](https://golua.fatality.win/documentation/datatypes/material_var) [Datatype](https://golua.fatality.win/documentation/datatypes/material_var) material var as a float number ### [hashtag](https://golua.fatality.win/documentation/datatypes/material_var#set_float) set\_float [Parameter](https://golua.fatality.win/documentation/datatypes/material_var) [Datatype](https://golua.fatality.win/documentation/datatypes/material_var) [Description](https://golua.fatality.win/documentation/datatypes/material_var) value number floating point value to set var to ### [hashtag](https://golua.fatality.win/documentation/datatypes/material_var#get_string) get\_string #### [hashtag](https://golua.fatality.win/documentation/datatypes/material_var#returns-2) Returns: [Value](https://golua.fatality.win/documentation/datatypes/material_var) [Datatype](https://golua.fatality.win/documentation/datatypes/material_var) material var as a string string ### [hashtag](https://golua.fatality.win/documentation/datatypes/material_var#set_string) set\_string [Parameter](https://golua.fatality.win/documentation/datatypes/material_var) [Datatype](https://golua.fatality.win/documentation/datatypes/material_var) [Description](https://golua.fatality.win/documentation/datatypes/material_var) value string string value to set var to ### [hashtag](https://golua.fatality.win/documentation/datatypes/material_var#get_vector) get\_vector #### [hashtag](https://golua.fatality.win/documentation/datatypes/material_var#returns-3) Returns: [Value](https://golua.fatality.win/documentation/datatypes/material_var) [Datatype](https://golua.fatality.win/documentation/datatypes/material_var) material var as a vector table table ### [hashtag](https://golua.fatality.win/documentation/datatypes/material_var#set_vector) set\_vector [Parameter](https://golua.fatality.win/documentation/datatypes/material_var) [Datatype](https://golua.fatality.win/documentation/datatypes/material_var) [Description](https://golua.fatality.win/documentation/datatypes/material_var) x number x value y number y value z number z value w number w value [Previousmaterialchevron-left](https://golua.fatality.win/documentation/datatypes/material) [Nextzipchevron-right](https://golua.fatality.win/documentation/datatypes/zip) Last updated 3 years ago * [Functions](https://golua.fatality.win/documentation/datatypes/material_var#functions) * [get\_int](https://golua.fatality.win/documentation/datatypes/material_var#get_int) * [set\_int](https://golua.fatality.win/documentation/datatypes/material_var#set_int) * [get\_float](https://golua.fatality.win/documentation/datatypes/material_var#get_float) * [set\_float](https://golua.fatality.win/documentation/datatypes/material_var#set_float) * [get\_string](https://golua.fatality.win/documentation/datatypes/material_var#get_string) * [set\_string](https://golua.fatality.win/documentation/datatypes/material_var#set_string) * [get\_vector](https://golua.fatality.win/documentation/datatypes/material_var#get_vector) * [set\_vector](https://golua.fatality.win/documentation/datatypes/material_var#set_vector) sun-brightdesktopmoon Copy material_var:set_float(1.5) Copy material_var:get_string() Copy material_var:set_string("abc") Copy material_var:get_vector() Copy material_var:set_vector(1, 2, 3) sun-brightdesktopmoon --- # game_event | Lua API circle-info List of [game eventsarrow-up-right](https://wiki.alliedmods.net/Counter-Strike:_Global_Offensive_Events) . [hashtag](https://golua.fatality.win/documentation/datatypes/game_event#functions) Functions ------------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/game_event#get_name) get\_name Copy function on_game_event(event) if event:get_name() == "player_hurt" then print("A player was hurt") end end #### [hashtag](https://golua.fatality.win/documentation/datatypes/game_event#usage) Usage: Gets the name of an event. ### [hashtag](https://golua.fatality.win/documentation/datatypes/game_event#get_int) get\_int Copy event:get_int("userid") [Parameter](https://golua.fatality.win/documentation/datatypes/game_event) [Datatype](https://golua.fatality.win/documentation/datatypes/game_event) [Description](https://golua.fatality.win/documentation/datatypes/game_event) key\_name string name of key #### [hashtag](https://golua.fatality.win/documentation/datatypes/game_event#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/game_event) [Datatype](https://golua.fatality.win/documentation/datatypes/game_event) key\_value number ### [hashtag](https://golua.fatality.win/documentation/datatypes/game_event#get_float) get\_float [Parameter](https://golua.fatality.win/documentation/datatypes/game_event) [Datatype](https://golua.fatality.win/documentation/datatypes/game_event) [Description](https://golua.fatality.win/documentation/datatypes/game_event) key\_name string name of key #### [hashtag](https://golua.fatality.win/documentation/datatypes/game_event#returns-1) Returns: [Value](https://golua.fatality.win/documentation/datatypes/game_event) [Datatype](https://golua.fatality.win/documentation/datatypes/game_event) key\_value number ### [hashtag](https://golua.fatality.win/documentation/datatypes/game_event#get_bool) get\_bool [Parameter](https://golua.fatality.win/documentation/datatypes/game_event) [Datatype](https://golua.fatality.win/documentation/datatypes/game_event) [Description](https://golua.fatality.win/documentation/datatypes/game_event) key\_name string name of key #### [hashtag](https://golua.fatality.win/documentation/datatypes/game_event#returns-2) Returns: [Value](https://golua.fatality.win/documentation/datatypes/game_event) [Datatype](https://golua.fatality.win/documentation/datatypes/game_event) key\_value boolean ### [hashtag](https://golua.fatality.win/documentation/datatypes/game_event#get_string) get\_string [Parameter](https://golua.fatality.win/documentation/datatypes/game_event) [Datatype](https://golua.fatality.win/documentation/datatypes/game_event) [Description](https://golua.fatality.win/documentation/datatypes/game_event) key\_name string name of key #### [hashtag](https://golua.fatality.win/documentation/datatypes/game_event#returns-3) Returns: [Value](https://golua.fatality.win/documentation/datatypes/game_event) [Datatype](https://golua.fatality.win/documentation/datatypes/game_event) key\_value string [Previousshot\_infochevron-left](https://golua.fatality.win/documentation/datatypes/shot_info) [Nextmaterialchevron-right](https://golua.fatality.win/documentation/datatypes/material) Last updated 3 years ago * [Functions](https://golua.fatality.win/documentation/datatypes/game_event#functions) * [get\_name](https://golua.fatality.win/documentation/datatypes/game_event#get_name) * [get\_int](https://golua.fatality.win/documentation/datatypes/game_event#get_int) * [get\_float](https://golua.fatality.win/documentation/datatypes/game_event#get_float) * [get\_bool](https://golua.fatality.win/documentation/datatypes/game_event#get_bool) * [get\_string](https://golua.fatality.win/documentation/datatypes/game_event#get_string) sun-brightdesktopmoon Copy event:get_float("x") Copy event:get_bool("attackerblind") Copy event:get_string("weapon") sun-brightdesktopmoon --- # vec3 | Lua API [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#variables) Variables ------------------------------------------------------------------------------------------- * x - number * y - number * z - number circle-info #### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#supported-operators) Supported operators: +, -, /, \* [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#functions) Functions ------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#unpack) unpack Copy local vector = math.vec3(1, 2, 3) local x, y, z = vector:unpack() #### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/vec3) [Datatype](https://golua.fatality.win/documentation/datatypes/vec3) x number y number z number ### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#length) length #### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#returns-1) Returns: [Value](https://golua.fatality.win/documentation/datatypes/vec3) [Datatype](https://golua.fatality.win/documentation/datatypes/vec3) the [lengtharrow-up-right](https://en.wikipedia.org/wiki/Euclidean_vector#Length) of the vector number ### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#length2d) length2d #### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#returns-2) Returns: [Value](https://golua.fatality.win/documentation/datatypes/vec3) [Datatype](https://golua.fatality.win/documentation/datatypes/vec3) the two dimensional [lengtharrow-up-right](https://en.wikipedia.org/wiki/Euclidean_vector#Length) of the vector number ### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#dist) dist [Parameter](https://golua.fatality.win/documentation/datatypes/vec3) [Datatype](https://golua.fatality.win/documentation/datatypes/vec3) [Description](https://golua.fatality.win/documentation/datatypes/vec3) other vector math.vec3 vector to calculate distance #### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#returns-3) Returns: [Value](https://golua.fatality.win/documentation/datatypes/vec3) [Datatype](https://golua.fatality.win/documentation/datatypes/vec3) distance number ### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#dist2d) dist2d [Parameter](https://golua.fatality.win/documentation/datatypes/vec3) [Datatype](https://golua.fatality.win/documentation/datatypes/vec3) [Description](https://golua.fatality.win/documentation/datatypes/vec3) other vector math.vec3 vector to calculate distance #### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#returns-4) Returns: [Value](https://golua.fatality.win/documentation/datatypes/vec3) [Datatype](https://golua.fatality.win/documentation/datatypes/vec3) 2-dimensional distance number ### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#to2d) to2d #### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#returns-5) Returns: [Value](https://golua.fatality.win/documentation/datatypes/vec3) [Datatype](https://golua.fatality.win/documentation/datatypes/vec3) the original vector with the z component set to 0 math.vec3 ### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#cross) cross [Parameter](https://golua.fatality.win/documentation/datatypes/vec3) [Datatype](https://golua.fatality.win/documentation/datatypes/vec3) [Description](https://golua.fatality.win/documentation/datatypes/vec3) other vector math.vec3 vector to cross with #### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#returns-6) Returns: [Value](https://golua.fatality.win/documentation/datatypes/vec3) [Datatype](https://golua.fatality.win/documentation/datatypes/vec3) the [cross productarrow-up-right](https://en.wikipedia.org/wiki/Euclidean_vector#Cross_product) of the two vectors math.vec3 ### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#normalize) normalize #### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#returns-7) Returns: [Value](https://golua.fatality.win/documentation/datatypes/vec3) [Datatype](https://golua.fatality.win/documentation/datatypes/vec3) the [vector normalizedarrow-up-right](https://stackoverflow.com/questions/10002918/what-is-the-need-for-normalizing-a-vector) math.vec3 ### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#dot) dot [Parameter](https://golua.fatality.win/documentation/datatypes/vec3) [Datatype](https://golua.fatality.win/documentation/datatypes/vec3) [Description](https://golua.fatality.win/documentation/datatypes/vec3) other vector math.vec3 vector to calculate dot product with #### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#returns-8) Returns: [Value](https://golua.fatality.win/documentation/datatypes/vec3) [Datatype](https://golua.fatality.win/documentation/datatypes/vec3) the two vectors [dot productarrow-up-right](https://en.wikipedia.org/wiki/Dot_product) number ### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#calc_angle) calc\_angle [Parameter](https://golua.fatality.win/documentation/datatypes/vec3) [Datatype](https://golua.fatality.win/documentation/datatypes/vec3) [Description](https://golua.fatality.win/documentation/datatypes/vec3) other vector math.vec3 vector to calculate angle with #### [hashtag](https://golua.fatality.win/documentation/datatypes/vec3#returns-9) Returns: [Value](https://golua.fatality.win/documentation/datatypes/vec3) [Datatype](https://golua.fatality.win/documentation/datatypes/vec3) the angle between the two vectors math.vec3 [Previoustrace\_tchevron-left](https://golua.fatality.win/documentation/datatypes/trace_t) [Nexttimerchevron-right](https://golua.fatality.win/documentation/datatypes/timer) Last updated 3 years ago * [Variables](https://golua.fatality.win/documentation/datatypes/vec3#variables) * [Functions](https://golua.fatality.win/documentation/datatypes/vec3#functions) * [unpack](https://golua.fatality.win/documentation/datatypes/vec3#unpack) * [length](https://golua.fatality.win/documentation/datatypes/vec3#length) * [length2d](https://golua.fatality.win/documentation/datatypes/vec3#length2d) * [dist](https://golua.fatality.win/documentation/datatypes/vec3#dist) * [dist2d](https://golua.fatality.win/documentation/datatypes/vec3#dist2d) * [to2d](https://golua.fatality.win/documentation/datatypes/vec3#to2d) * [cross](https://golua.fatality.win/documentation/datatypes/vec3#cross) * [normalize](https://golua.fatality.win/documentation/datatypes/vec3#normalize) * [dot](https://golua.fatality.win/documentation/datatypes/vec3#dot) * [calc\_angle](https://golua.fatality.win/documentation/datatypes/vec3#calc_angle) sun-brightdesktopmoon Copy local vector = math.vec3(1, 0, 0) vector:length() Copy local vector = math.vec3(1, 0, 0) vector:length2d() Copy local vector = math.vec3(1, 0, 0) local vector2 = math.vec3(5, 5, 5) print(vector:dist(vector2)) Copy local vector = math.vec3(1, 0, 0) local vector2 = math.vec3(5, 5, 5) print(vector:dist2d(vector2)) Copy local vector = math.vec3(1, 0, 0) vector:to2d() Copy local vector1 = math.vec3(1, 0, 0) local vector2 = math.vec3(0, 1, 0) local cross_product = vector1:cross(vector2) Copy local vector1 = math.vec3(50, 50, 100) local vector_normalized = vector1:normalize() Copy local vector1 = math.vec3(50, 50, 100) local dot_product = vector1:dot(math.vec3(1, 33, 7)) Copy local vector1 = math.vec3(50, 50, 100) local vector2 = math.vec3(1, 33, 7) local angle = vector1:calc_angle(vector2) sun-brightdesktopmoon --- # zip | Lua API [hashtag](https://golua.fatality.win/documentation/datatypes/zip#functions) Functions ------------------------------------------------------------------------------------------ ### [hashtag](https://golua.fatality.win/documentation/datatypes/zip#read) read Copy zip_object:read("folder/file.txt") [Parameter](https://golua.fatality.win/documentation/datatypes/zip) [Datatype](https://golua.fatality.win/documentation/datatypes/zip) [Description](https://golua.fatality.win/documentation/datatypes/zip) path string path to file #### [hashtag](https://golua.fatality.win/documentation/datatypes/zip#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/zip) [Datatype](https://golua.fatality.win/documentation/datatypes/zip) contents string ### [hashtag](https://golua.fatality.win/documentation/datatypes/zip#read_stream) read\_stream Copy zip_object:read_stream("folder/file.txt") [Parameter](https://golua.fatality.win/documentation/datatypes/zip) [Datatype](https://golua.fatality.win/documentation/datatypes/zip) [Description](https://golua.fatality.win/documentation/datatypes/zip) path string path to file #### [hashtag](https://golua.fatality.win/documentation/datatypes/zip#returns-1) Returns: [Value](https://golua.fatality.win/documentation/datatypes/zip) [Datatype](https://golua.fatality.win/documentation/datatypes/zip) file stream table of char ### [hashtag](https://golua.fatality.win/documentation/datatypes/zip#write) write [Parameter](https://golua.fatality.win/documentation/datatypes/zip) [Datatype](https://golua.fatality.win/documentation/datatypes/zip) [Description](https://golua.fatality.win/documentation/datatypes/zip) path string path to file data string content to write to file ### [hashtag](https://golua.fatality.win/documentation/datatypes/zip#write_stream) write\_stream [Parameter](https://golua.fatality.win/documentation/datatypes/zip) [Datatype](https://golua.fatality.win/documentation/datatypes/zip) [Description](https://golua.fatality.win/documentation/datatypes/zip) path string path to file data table of char stream to write ### [hashtag](https://golua.fatality.win/documentation/datatypes/zip#save) save circle-info Saves the file's content ### [hashtag](https://golua.fatality.win/documentation/datatypes/zip#get_files) get\_files #### [hashtag](https://golua.fatality.win/documentation/datatypes/zip#returns-2) Returns: [Value](https://golua.fatality.win/documentation/datatypes/zip) [Datatype](https://golua.fatality.win/documentation/datatypes/zip) files table ### [hashtag](https://golua.fatality.win/documentation/datatypes/zip#exists) exists [Parameter](https://golua.fatality.win/documentation/datatypes/zip) [Datatype](https://golua.fatality.win/documentation/datatypes/zip) [Description](https://golua.fatality.win/documentation/datatypes/zip) path string path to file #### [hashtag](https://golua.fatality.win/documentation/datatypes/zip#returns-3) Returns: [Value](https://golua.fatality.win/documentation/datatypes/zip) [Datatype](https://golua.fatality.win/documentation/datatypes/zip) true if file exists boolean ### [hashtag](https://golua.fatality.win/documentation/datatypes/zip#extract) extract [Parameter](https://golua.fatality.win/documentation/datatypes/zip) [Datatype](https://golua.fatality.win/documentation/datatypes/zip) [Description](https://golua.fatality.win/documentation/datatypes/zip) path string path to file destination string directory to extract file to ### [hashtag](https://golua.fatality.win/documentation/datatypes/zip#extract_all) extract\_all [Parameter](https://golua.fatality.win/documentation/datatypes/zip) [Datatype](https://golua.fatality.win/documentation/datatypes/zip) [Description](https://golua.fatality.win/documentation/datatypes/zip) destination string directory to extract file to [Previousmaterial\_varchevron-left](https://golua.fatality.win/documentation/datatypes/material_var) [Nextanimatorchevron-right](https://golua.fatality.win/documentation/datatypes/animator) Last updated 3 years ago * [Functions](https://golua.fatality.win/documentation/datatypes/zip#functions) * [read](https://golua.fatality.win/documentation/datatypes/zip#read) * [read\_stream](https://golua.fatality.win/documentation/datatypes/zip#read_stream) * [write](https://golua.fatality.win/documentation/datatypes/zip#write) * [write\_stream](https://golua.fatality.win/documentation/datatypes/zip#write_stream) * [save](https://golua.fatality.win/documentation/datatypes/zip#save) * [get\_files](https://golua.fatality.win/documentation/datatypes/zip#get_files) * [exists](https://golua.fatality.win/documentation/datatypes/zip#exists) * [extract](https://golua.fatality.win/documentation/datatypes/zip#extract) * [extract\_all](https://golua.fatality.win/documentation/datatypes/zip#extract_all) sun-brightdesktopmoon Copy zip_object:write("folder/file.txt", "data") Copy zip_object:write_stream("folder/file.txt", {"a", "b", "c"}) Copy zip_object:save() Copy zip_object:get_files() Copy zip_object:exists("folder/file.txt") Copy zip_object:extract("folder/file.txt", "some_directory") Copy zip_object:extract_all("some_directory") sun-brightdesktopmoon --- # material | Lua API [hashtag](https://golua.fatality.win/documentation/datatypes/material#functions) Functions ----------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/material#modulate) modulate Copy material:modulate(render.color(255, 0, 0, 0)) [Parameter](https://golua.fatality.win/documentation/datatypes/material) [Datatype](https://golua.fatality.win/documentation/datatypes/material) [Description](https://golua.fatality.win/documentation/datatypes/material) color [render.color](https://golua.fatality.win/documentation/namespaces/render#color) color to modulate material to ### [hashtag](https://golua.fatality.win/documentation/datatypes/material#get_flag) get\_flag Copy material:get_flag(mat.var_ignorez) [Parameter](https://golua.fatality.win/documentation/datatypes/material) [Datatype](https://golua.fatality.win/documentation/datatypes/material) [Description](https://golua.fatality.win/documentation/datatypes/material) flag [material var flag](https://golua.fatality.win/documentation/datatypes/material#material-vars) flag to get #### [hashtag](https://golua.fatality.win/documentation/datatypes/material#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/material) [Datatype](https://golua.fatality.win/documentation/datatypes/material) flag state boolean ### [hashtag](https://golua.fatality.win/documentation/datatypes/material#set_flag) set\_flag Copy material:set_flag(mat.var_ignorez, true) [Parameter](https://golua.fatality.win/documentation/datatypes/material) [Datatype](https://golua.fatality.win/documentation/datatypes/material) [Description](https://golua.fatality.win/documentation/datatypes/material) flag [material var flag](https://golua.fatality.win/documentation/datatypes/material#material-vars) flag to set state boolean new state ### [hashtag](https://golua.fatality.win/documentation/datatypes/material#find_var) find\_var [Parameter](https://golua.fatality.win/documentation/datatypes/material) [Datatype](https://golua.fatality.win/documentation/datatypes/material) [Description](https://golua.fatality.win/documentation/datatypes/material) variable name string [variable namearrow-up-right](https://developer.valvesoftware.com/wiki/Category:List_of_Shader_Parameters) #### [hashtag](https://golua.fatality.win/documentation/datatypes/material#returns-1) Returns: [Value](https://golua.fatality.win/documentation/datatypes/material) [Datatype](https://golua.fatality.win/documentation/datatypes/material) var object [material var](https://golua.fatality.win/documentation/datatypes/material_var) ### [hashtag](https://golua.fatality.win/documentation/datatypes/material#get_name) get\_name #### [hashtag](https://golua.fatality.win/documentation/datatypes/material#returns-2) Returns: [Value](https://golua.fatality.win/documentation/datatypes/material) [Datatype](https://golua.fatality.win/documentation/datatypes/material) material's name string ### [hashtag](https://golua.fatality.win/documentation/datatypes/material#get_group) get\_group #### [hashtag](https://golua.fatality.win/documentation/datatypes/material#returns-3) Returns: [Value](https://golua.fatality.win/documentation/datatypes/material) [Datatype](https://golua.fatality.win/documentation/datatypes/material) material's group name string [hashtag](https://golua.fatality.win/documentation/datatypes/material#enums) Enums --------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/material#material-var-flags) Material var flags * var\_debug * var\_no\_debug\_override * var\_no\_draw * var\_use\_in\_fillrate\_mode * var\_vertexcolor * var\_vertexalpha * var\_selfillum * var\_additive * var\_alphatest * var\_znearer * var\_model * var\_flat * var\_nocull * var\_nofog * var\_ignorez * var\_decal * var\_envmapsphere * var\_envmapcameraspace * var\_basealphaenvmapmask * var\_translucent * var\_normalmapalphaenvmapmask * var\_needs\_software\_skinning * var\_opaquetexture * var\_envmapmode * var\_suppress\_decals * var\_halflambert * var\_wireframe * var\_allowalphatocoverage * var\_alpha\_modified\_by\_proxy * var\_vertexfog [Previousgame\_eventchevron-left](https://golua.fatality.win/documentation/datatypes/game_event) [Nextmaterial\_varchevron-right](https://golua.fatality.win/documentation/datatypes/material_var) Last updated 3 years ago * [Functions](https://golua.fatality.win/documentation/datatypes/material#functions) * [modulate](https://golua.fatality.win/documentation/datatypes/material#modulate) * [get\_flag](https://golua.fatality.win/documentation/datatypes/material#get_flag) * [set\_flag](https://golua.fatality.win/documentation/datatypes/material#set_flag) * [find\_var](https://golua.fatality.win/documentation/datatypes/material#find_var) * [get\_name](https://golua.fatality.win/documentation/datatypes/material#get_name) * [get\_group](https://golua.fatality.win/documentation/datatypes/material#get_group) * [Enums](https://golua.fatality.win/documentation/datatypes/material#enums) * [Material var flags](https://golua.fatality.win/documentation/datatypes/material#material-var-flags) sun-brightdesktopmoon Copy material:find_var("$basetexture") Copy material:get_name() Copy material:get_group() sun-brightdesktopmoon --- # entity | Lua API [hashtag](https://golua.fatality.win/documentation/datatypes/entity#entity) Entity --------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#get_index) get\_index Copy local ent = entities.get_entity(1) ent:get_index() #### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#returns) Returns: [Value](https://golua.fatality.win/documentation/datatypes/entity) [Datatype](https://golua.fatality.win/documentation/datatypes/entity) entity index number ### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#is_player) is\_player Copy local ent = entities.get_entity(1) ent:is_player() #### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#returns-1) Returns: [Value](https://golua.fatality.win/documentation/datatypes/entity) [Datatype](https://golua.fatality.win/documentation/datatypes/entity) whether or not the entity is a player boolean ### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#get_class) get\_class Copy ent:get_class() -- ex: CCSPlayer #### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#returns-2) Returns: [Value](https://golua.fatality.win/documentation/datatypes/entity) [Datatype](https://golua.fatality.win/documentation/datatypes/entity) entity's class name string ### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#get_prop) get\_prop [Parameter](https://golua.fatality.win/documentation/datatypes/entity) [Datatype](https://golua.fatality.win/documentation/datatypes/entity) [Description](https://golua.fatality.win/documentation/datatypes/entity) [Default value](https://golua.fatality.win/documentation/datatypes/entity) name string prop name ❌ table index number index of prop if it is an array 0 #### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#returns-3) Returns: [Value](https://golua.fatality.win/documentation/datatypes/entity) [Datatype](https://golua.fatality.win/documentation/datatypes/entity) prop's value number, string, boolean, [math.vec3](https://golua.fatality.win/documentation/datatypes/vec3) ### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#set_prop) set\_prop [Parameter](https://golua.fatality.win/documentation/datatypes/entity) [Datatype](https://golua.fatality.win/documentation/datatypes/entity) [Description](https://golua.fatality.win/documentation/datatypes/entity) name string prop name table index number index of prop if it is an array value any value to set prop to #### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#usage) Usage: Sets prop's value. file-download 760KB [netvar\_dump.json](https://3509372639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FafgbISA4aNSPwgb4N4AD%2Fuploads%2F3c0vzkTqq7LKT08U6XWi%2Fnetvar_dump.json?alt=media&token=92a93ebe-0602-4662-b568-c5a5ae1eca77) downloadDownload[arrow-up-right-from-squareOpen](https://3509372639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FafgbISA4aNSPwgb4N4AD%2Fuploads%2F3c0vzkTqq7LKT08U6XWi%2Fnetvar_dump.json?alt=media&token=92a93ebe-0602-4662-b568-c5a5ae1eca77) ### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#is_alive) is\_alive #### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#returns-4) Returns: [Value](https://golua.fatality.win/documentation/datatypes/entity) [Datatype](https://golua.fatality.win/documentation/datatypes/entity) whether or not the entity is alive boolean ### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#get_esp_alpha) get\_esp\_alpha #### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#returns-5) Returns: [Value](https://golua.fatality.win/documentation/datatypes/entity) [Datatype](https://golua.fatality.win/documentation/datatypes/entity) esp alpha (0 - 255) float [hashtag](https://golua.fatality.win/documentation/datatypes/entity#player) Player --------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#is_valid) is\_valid #### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#returns-6) Returns: [Value](https://golua.fatality.win/documentation/datatypes/entity) [Datatype](https://golua.fatality.win/documentation/datatypes/entity) true if the player is alive and not dormant boolean ### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#is_enemy) is\_enemy #### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#returns-7) Returns: [Value](https://golua.fatality.win/documentation/datatypes/entity) [Datatype](https://golua.fatality.win/documentation/datatypes/entity) true if the player is an enemy boolean ### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#get_player_info) get\_player\_info #### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#returns-8) Returns: [Value](https://golua.fatality.win/documentation/datatypes/entity) [Datatype](https://golua.fatality.win/documentation/datatypes/entity) the player's info [player\_info](https://golua.fatality.win/documentation/datatypes/player_info) ### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#get_bbox) get\_bbox #### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#returns-9) Returns: [Value](https://golua.fatality.win/documentation/datatypes/entity) [Datatype](https://golua.fatality.win/documentation/datatypes/entity) x1 number y1 number x2 number y2 number circle-exclamation Only works on enemy players! ### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#get_weapon) get\_weapon #### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#returns-10) Returns: [Value](https://golua.fatality.win/documentation/datatypes/entity) [Datatype](https://golua.fatality.win/documentation/datatypes/entity) the player's active weapon [entity](https://golua.fatality.win/documentation/datatypes/entity#entity) ### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#get_eye_position) get\_eye\_position #### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#returns-11) Returns: [Value](https://golua.fatality.win/documentation/datatypes/entity) [Datatype](https://golua.fatality.win/documentation/datatypes/entity) x number y number z number ### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#get_hitbox_position) get\_hitbox\_position [Parameter](https://golua.fatality.win/documentation/datatypes/entity) [Datatype](https://golua.fatality.win/documentation/datatypes/entity) [Description](https://golua.fatality.win/documentation/datatypes/entity) hitbox\_index number the hitbox id #### [hashtag](https://golua.fatality.win/documentation/datatypes/entity#returns-12) Returns: [Value](https://golua.fatality.win/documentation/datatypes/entity) [Datatype](https://golua.fatality.win/documentation/datatypes/entity) x number y number z number [Previouslistchevron-left](https://golua.fatality.win/documentation/datatypes/list) [Nextplayer\_infochevron-right](https://golua.fatality.win/documentation/datatypes/player_info) Last updated 2 years ago * [Entity](https://golua.fatality.win/documentation/datatypes/entity#entity) * [get\_index](https://golua.fatality.win/documentation/datatypes/entity#get_index) * [is\_player](https://golua.fatality.win/documentation/datatypes/entity#is_player) * [get\_class](https://golua.fatality.win/documentation/datatypes/entity#get_class) * [get\_prop](https://golua.fatality.win/documentation/datatypes/entity#get_prop) * [set\_prop](https://golua.fatality.win/documentation/datatypes/entity#set_prop) * [is\_alive](https://golua.fatality.win/documentation/datatypes/entity#is_alive) * [get\_esp\_alpha](https://golua.fatality.win/documentation/datatypes/entity#get_esp_alpha) * [Player](https://golua.fatality.win/documentation/datatypes/entity#player) * [is\_valid](https://golua.fatality.win/documentation/datatypes/entity#is_valid) * [is\_enemy](https://golua.fatality.win/documentation/datatypes/entity#is_enemy) * [get\_player\_info](https://golua.fatality.win/documentation/datatypes/entity#get_player_info) * [get\_bbox](https://golua.fatality.win/documentation/datatypes/entity#get_bbox) * [get\_weapon](https://golua.fatality.win/documentation/datatypes/entity#get_weapon) * [get\_eye\_position](https://golua.fatality.win/documentation/datatypes/entity#get_eye_position) * [get\_hitbox\_position](https://golua.fatality.win/documentation/datatypes/entity#get_hitbox_position) sun-brightdesktopmoon Copy ent:get_prop("m_hMyWeapons", 1) Copy ent:set_prop("m_bSpotted", 0, true) Copy ent:is_alive() Copy local player = entities.get_entity(engine.get_local_player()) player:is_valid() Copy player:is_enemy() Copy player:get_player_info() Copy local x1, y1, x2, y2 = player:get_bbox() Copy player:get_weapon() Copy player:get_eye_position() Copy player:get_hitbox_position(1) sun-brightdesktopmoon --- # Render | Lua API [hashtag](https://golua.fatality.win/documentation/namespaces/render#enums) Enums -------------------------------------------------------------------------------------- chevron-rightFont flags[hashtag](https://golua.fatality.win/documentation/namespaces/render#font-flags) font\_flag\_shadow font\_flag\_outline chevron-rightRect rounding[hashtag](https://golua.fatality.win/documentation/namespaces/render#rect-rounding) top\_left top\_right bottom\_left bottom\_right top left bottom right all chevron-rightRect outline[hashtag](https://golua.fatality.win/documentation/namespaces/render#rect-outline) outline\_inset outline\_outset outline\_center chevron-rightText alignment[hashtag](https://golua.fatality.win/documentation/namespaces/render#text-alignment) align\_top align\_left align\_center align\_right align\_bottom chevron-rightEasings[hashtag](https://golua.fatality.win/documentation/namespaces/render#easings) * linear * ease\_in * ease\_out * ease\_in\_out * elastic\_in * elastic\_out * elastic\_in\_out * bounce\_in * bounce\_out * bounce\_in\_out [hashtag](https://golua.fatality.win/documentation/namespaces/render#datatypes) Datatypes ---------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#color) color [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) [Default Value](https://golua.fatality.win/documentation/namespaces/render) r number red channel (0-255) ❌ g number green channel (0-255) ❌ b number blue channel (0-255) ❌ a number alpha channel (0-255) 255 [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) hex\_code string hex color code #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) table with rgba values table #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#table-structure) Table structure: ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#esp_flag) esp\_flag [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) text string flag to draw color [render.color](https://golua.fatality.win/documentation/namespaces/render#color) color to draw [hashtag](https://golua.fatality.win/documentation/namespaces/render#fonts) Fonts -------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#create_font) create\_font [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) [Default Value](https://golua.fatality.win/documentation/namespaces/render) font\_path string path to font or name of font ❌ size number font size ❌ flags [render.font\_flag](https://golua.fatality.win/documentation/namespaces/render#font-flags) font flag 0 from number minimum [codepointarrow-up-right](https://en.wikipedia.org/wiki/Code_point) 0 to number maximum [codepointarrow-up-right](https://en.wikipedia.org/wiki/Code_point) 255 #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns-1) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) font id number ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#create_font_gdi) create\_font\_gdi [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) [Default Value](https://golua.fatality.win/documentation/namespaces/render) font\_path string path to font or name of font ❌ size number font size ❌ flags [render.font\_flag](https://golua.fatality.win/documentation/namespaces/render#font-flags) font flag 0 from number minimum [codepointarrow-up-right](https://en.wikipedia.org/wiki/Code_point) 0 to number maximum [codepointarrow-up-right](https://en.wikipedia.org/wiki/Code_point) 255 #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns-2) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) font id number ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#create_font_stream) create\_font\_stream [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) [Default Value](https://golua.fatality.win/documentation/namespaces/render) bytes table table of bytes ❌ size number font size ❌ flags [render.font\_flag](https://golua.fatality.win/documentation/namespaces/render#font-flags) font flag 0 from number minimum [codepointarrow-up-right](https://en.wikipedia.org/wiki/Code_point) 0 to number maximum [codepointarrow-up-right](https://en.wikipedia.org/wiki/Code_point) 255 #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns-3) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) font id number ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#get_text_size) get\_text\_size [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) font number font id from [render.create\_font](https://golua.fatality.win/documentation/namespaces/render#create_font) text string string to measure #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns-4) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) width number height number ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#wrap_text) wrap\_text [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) font number font id from [render.create\_font](https://golua.fatality.win/documentation/namespaces/render#create_font) text string string to measure width number target text width #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns-5) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) text string ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#text) text [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) [Default Value](https://golua.fatality.win/documentation/namespaces/render) font number font id (see [render.create\_font](https://golua.fatality.win/documentation/namespaces/render#create_font) ) ❌ x number first x coord ❌ y number first y coord ❌ text string text to draw ❌ color table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) ❌ align\_horizontal number horizontal alignment type [render.align\_left](https://golua.fatality.win/documentation/namespaces/render#text-alignment) align\_vertical number vertical alignment type [render.align\_top](https://golua.fatality.win/documentation/namespaces/render#text-alignment) align\_line number multiline alignment type [render.align\_left](https://golua.fatality.win/documentation/namespaces/render#text-alignment) #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#pre-defined-fonts) Pre-defined fonts: * font\_gui\_main * font\_gui\_title * font\_gui\_bold * font\_esp * font\_esp\_name * font\_indicator [hashtag](https://golua.fatality.win/documentation/namespaces/render#shaders) Shaders ------------------------------------------------------------------------------------------ ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#create_shader) create\_shader [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) src string shader source code #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#supported-pre-defined-shader-parameters) Supported pre-defined shader parameters: Register Type [Description](https://golua.fatality.win/documentation/namespaces/render) s0 sampler current texture c0 float2 current texture's dimensions c1 float current time in seconds c2 float current global alpha override #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns-6) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) shader id number ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#set_shader) set\_shader [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) shader\_id number / nil shader id returned from render.create\_shader #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#usage) Usage: Sets or resets a shader. [hashtag](https://golua.fatality.win/documentation/namespaces/render#textures) Textures -------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#create_texture) create\_texture [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) texture\_path string path to texture #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#supported-image-formats) Supported image formats: * JPEG * PNG * BMP * GIF (non-animated) * TGA * PSD * HDR * PIC * PNM (binary only) #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns-7) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) texture id number ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#create_texture_bytes) create\_texture\_bytes [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) bytes unsigned char\* array of bytes size number texture size #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#supported-image-formats-1) Supported Image Formats: * JPEG * PNG * BMP * GIF (non-animated) * TGA * PSD * HDR * PIC * PNM (binary only) #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns-8) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) texture id number #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#note) Note: This function can only be used by utilizing the ffi library as it requires a byte array. One way to do such would be using [ISteamUtils::GetImageRGBAarrow-up-right](https://partner.steamgames.com/doc/api/ISteamUtils#GetImageRGBA) . ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#create_texture_rgba) create\_texture\_rgba [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) bytes unsigned char\* array of bytes w number texture width h number texture height row\_stride number number of bytes in each row (image width \* 4) #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#supported-image-formats-2) Supported Image Formats: * JPEG * PNG * BMP * GIF (non-animated) * TGA * PSD * HDR * PIC * PNM (binary only) #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns-9) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) texture id number #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#note-1) Note: This function can only be used by utilizing the ffi library as it requires a byte array. One way to do such would be using [ISteamUtils::GetImageRGBAarrow-up-right](https://partner.steamgames.com/doc/api/ISteamUtils#GetImageRGBA) . ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#create_texture_stream) create\_texture\_stream [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) byte\_stream table of bytes texture bytes #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns-10) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) texture id number ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#create_texture_svg) create\_texture\_svg [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) image string svg data or svg file path target\_height number desired image height #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns-11) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) texture id number ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#push_texture-set_texture) push\_texture / set\_texture [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) texture\_id number texture id returned from render.create\_texture #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#pre-defined-textures) Pre-defined textures: * texture\_logo\_head * texture\_logo\_stripes * texture\_cursor * texture\_loading * texture\_icon\_up * texture\_icon\_down * texture\_icon\_clear * texture\_icon\_copy * texture\_icon\_pase * texture\_icon\_add * texture\_icon\_search * texture\_icon\_settings * texture\_icon\_bug * texture\_icon\_rage * texture\_icon\_legit * texture\_icon\_visuals * texture\_icon\_misc * texture\_icon\_scripts * texture\_icon\_skins * texture\_avatar #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#usage-1) Usage: Sets a texture used by render functions. ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#pop_texture) pop\_texture #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#usage-2) Usage: Pops a previously used texture ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#push_uv-set_uv) push\_uv / set\_uv [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) x1 number min x coord (0 - 1) y1 number min y coord (0 - 1) x2 number max x coord (0 - 1) y2 number max y coord (0 - 1) #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#usage-3) Usage: Adjusts texture coordinates. Use after calling [render.push\_texture](https://golua.fatality.win/documentation/namespaces/render#push_texture) . ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#pop_uv) pop\_uv #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#usage-4) Usage: Pops a previously used set of texture coordinates. ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#get_texture_size) get\_texture\_size [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) texture\_id number texture id from [create\_texture](https://golua.fatality.win/documentation/namespaces/render#create_texture) #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns-5-1) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) width number height number ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#get_frame_count) get\_frame\_count [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) texture\_id number texture id from [create\_texture](https://golua.fatality.win/documentation/namespaces/render#create_texture) #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns-12) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) framecount number circle-exclamation This function will return 0 if a texture is NOT an animated GIF. [hashtag](https://golua.fatality.win/documentation/namespaces/render#drawing) Drawing ------------------------------------------------------------------------------------------ ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#get_screen_size) get\_screen\_size #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns-13) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) width number height number ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#push_clip_rect) push\_clip\_rect [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) [Default Value](https://golua.fatality.win/documentation/namespaces/render) x1 number min x point ❌ y1 number min y point ❌ x2 number max x point ❌ x2 number max y point ❌ intersect boolean should it intersect with existing clip rects false #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#usage-5) Usage: Pushes a clip rect so elements can only be drawn within the rect. circle-exclamation Make sure to follow the call with [render.pop\_clip\_rect](https://golua.fatality.win/documentation/namespaces/render#pop_clip_rect) ! Failure to do so will result in undefined behavior! ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#pop_clip_rect) pop\_clip\_rect #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#usage-6) Usage: Pops a previously used clip rect ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#rect_filled) rect\_filled [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) x1 number min x point y1 number min y point x2 number max x point y2 number max y point color table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#rec) Usage: Draws a filled rectangle. Use [render.push\_texture](https://golua.fatality.win/documentation/namespaces/render#push_texture) to apply a texture to the shape. ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#rec-1) rect [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) [Default Value](https://golua.fatality.win/documentation/namespaces/render) x1 number min x point ❌ y1 number min y point ❌ x2 number max x point ❌ y2 number max y point ❌ color table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) ❌ thickness float thickness of line 1.f outline number outline type [render.outline\_inset](https://golua.fatality.win/documentation/namespaces/render#enums) ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#rect_filled-1) rect\_rounded [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) [Default Value](https://golua.fatality.win/documentation/namespaces/render) x1 number min x point ❌ y1 number min y point ❌ x2 number max x point ❌ y2 number max y point ❌ color table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) ❌ rounding number amount of rounding ❌ rounding\_flags number corners to round [render.all](https://golua.fatality.win/documentation/namespaces/render#enums) thickness float thickness of line 1.f outline number outline type [render.outline\_inset](https://golua.fatality.win/documentation/namespaces/render#enums) #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#rec-2) Usage: Draws a filled rounded rectangle. Use [render.push\_texture](https://golua.fatality.win/documentation/namespaces/render#push_texture) to apply a texture to the shape. ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#rect_filled-2) rect\_filled\_rounded [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) [Default Value](https://golua.fatality.win/documentation/namespaces/render) x1 number min x point ❌ y1 number min y point ❌ x2 number max x point ❌ y2 number max y point ❌ color table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) ❌ rounding number amount of rounding ❌ rounding\_flags number corners to round [render.all](https://golua.fatality.win/documentation/namespaces/render#undefined) #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#rec-3) Usage: Draws a filled rounded rectangle. Use [render.push\_texture](https://golua.fatality.win/documentation/namespaces/render#push_texture) to apply a texture to the shape. ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#rect_filled_multicolor) rect\_filled\_multicolor [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) x1 number min x point y1 number min y point x2 number max x point y2 number max y point top\_left table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) top\_right table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) bottom\_right table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) bottom\_left table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#usage-7) Usage: Draws a multi-color rectangle. ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#circle_filled) circle\_filled [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) [Default Value](https://golua.fatality.win/documentation/namespaces/render) x number center x point ❌ y number center y point ❌ radius number the circles radius ❌ color table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) ❌ segments number number of points (circle resolution) 12 percentage number how much of the circle is drawn (0 - 1) 1 angle number circle rotation (0 - 360Draws a filled multi-color rectangle.) 0 #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#rec-4) Usage: Draws a filled circle. Use [render.push\_texture](https://golua.fatality.win/documentation/namespaces/render#push_texture) to apply a texture to the shape. ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#circle) circle [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) [Default Value](https://golua.fatality.win/documentation/namespaces/render) x number center x point ❌ y number center y point ❌ radius number the circles radius ❌ color table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) ❌ thickness number thickness of the circle in pixels 1 segments number number of points (circle resolution) 12 percentage number how much of the circle is drawn (0 - 1) 1 angle number circle rotation (0 - 360) 0 ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#line) line [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) x1 number first x coord y1 number first y coord x2 number second x coord y2 number second y coord color table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#line_multicolor) line\_multicolor [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) x1 number first x coord y1 number first y coord x2 number second x coord y2 number second y coord color table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) color2 table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#triangle_filled) triangle\_filled [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) x1 number first x coord y1 number first y coord x2 number second x coord y2 number second y coord x3 number third x coord y3 number third y coord color table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#rec-5) Usage: Draws a filled triangle. Use [render.push\_texture](https://golua.fatality.win/documentation/namespaces/render#push_texture) to apply a texture to the shape. ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#triangle) triangle [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) x1 number first x coord y1 number first y coord x2 number second x coord y2 number second y coord x3 number third x coord y3 number third y coord color table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#triangle_filled_multicolor) triangle\_filled\_multicolor [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) x1 number first x coord y1 number first y coord x2 number second x coord y2 number second y coord x3 number third x coord y3 number third y coord color1 table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) color2 table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) color3 table table of rgba values see [render.color](https://golua.fatality.win/documentation/namespaces/render#color) [hashtag](https://golua.fatality.win/documentation/namespaces/render#animations) Animations ------------------------------------------------------------------------------------------------ ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#create_animator_float) create\_animator\_float [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) [Default value](https://golua.fatality.win/documentation/namespaces/render) initial\_value [color](https://golua.fatality.win/documentation/namespaces/render#color) starting value ❌ duration number how long to take in seconds ❌ easing\_type [render.easing](https://golua.fatality.win/documentation/namespaces/render#easings) the animation type [render.linear](https://golua.fatality.win/documentation/namespaces/render#easings) #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns-14) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) animator object [animator](https://golua.fatality.win/documentation/datatypes/animator) ### [hashtag](https://golua.fatality.win/documentation/namespaces/render#create_animator_color) create\_animator\_color [Parameter](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) [Description](https://golua.fatality.win/documentation/namespaces/render) [Default value](https://golua.fatality.win/documentation/namespaces/render) initial\_value [color](https://golua.fatality.win/documentation/namespaces/render#color) starting value ❌ duration number how long to take in seconds ❌ easing\_type [render.easing](https://golua.fatality.win/documentation/namespaces/render#easings) the animation type [render.linear](https://golua.fatality.win/documentation/namespaces/render#easings) interpolate\_hue boolean should the hue be animated false #### [hashtag](https://golua.fatality.win/documentation/namespaces/render#returns-15) Returns: [Value](https://golua.fatality.win/documentation/namespaces/render) [Datatype](https://golua.fatality.win/documentation/namespaces/render) animator object [animator](https://golua.fatality.win/documentation/datatypes/animator) [PreviousGuichevron-left](https://golua.fatality.win/documentation/namespaces/gui) [NextEnginechevron-right](https://golua.fatality.win/documentation/namespaces/engine) Last updated 2 years ago * [Enums](https://golua.fatality.win/documentation/namespaces/render#enums) * [Datatypes](https://golua.fatality.win/documentation/namespaces/render#datatypes) * [color](https://golua.fatality.win/documentation/namespaces/render#color) * [esp\_flag](https://golua.fatality.win/documentation/namespaces/render#esp_flag) * [Fonts](https://golua.fatality.win/documentation/namespaces/render#fonts) * [create\_font](https://golua.fatality.win/documentation/namespaces/render#create_font) * [create\_font\_gdi](https://golua.fatality.win/documentation/namespaces/render#create_font_gdi) * [create\_font\_stream](https://golua.fatality.win/documentation/namespaces/render#create_font_stream) * [get\_text\_size](https://golua.fatality.win/documentation/namespaces/render#get_text_size) * [wrap\_text](https://golua.fatality.win/documentation/namespaces/render#wrap_text) * [text](https://golua.fatality.win/documentation/namespaces/render#text) * [Shaders](https://golua.fatality.win/documentation/namespaces/render#shaders) * [create\_shader](https://golua.fatality.win/documentation/namespaces/render#create_shader) * [set\_shader](https://golua.fatality.win/documentation/namespaces/render#set_shader) * [Textures](https://golua.fatality.win/documentation/namespaces/render#textures) * [create\_texture](https://golua.fatality.win/documentation/namespaces/render#create_texture) * [create\_texture\_bytes](https://golua.fatality.win/documentation/namespaces/render#create_texture_bytes) * [create\_texture\_rgba](https://golua.fatality.win/documentation/namespaces/render#create_texture_rgba) * [create\_texture\_stream](https://golua.fatality.win/documentation/namespaces/render#create_texture_stream) * [create\_texture\_svg](https://golua.fatality.win/documentation/namespaces/render#create_texture_svg) * [push\_texture / set\_texture](https://golua.fatality.win/documentation/namespaces/render#push_texture-set_texture) * [pop\_texture](https://golua.fatality.win/documentation/namespaces/render#pop_texture) * [push\_uv / set\_uv](https://golua.fatality.win/documentation/namespaces/render#push_uv-set_uv) * [pop\_uv](https://golua.fatality.win/documentation/namespaces/render#pop_uv) * [get\_texture\_size](https://golua.fatality.win/documentation/namespaces/render#get_texture_size) * [get\_frame\_count](https://golua.fatality.win/documentation/namespaces/render#get_frame_count) * [Drawing](https://golua.fatality.win/documentation/namespaces/render#drawing) * [get\_screen\_size](https://golua.fatality.win/documentation/namespaces/render#get_screen_size) * [push\_clip\_rect](https://golua.fatality.win/documentation/namespaces/render#push_clip_rect) * [pop\_clip\_rect](https://golua.fatality.win/documentation/namespaces/render#pop_clip_rect) * [rect\_filled](https://golua.fatality.win/documentation/namespaces/render#rect_filled) * [rect](https://golua.fatality.win/documentation/namespaces/render#rec-1) * [rect\_rounded](https://golua.fatality.win/documentation/namespaces/render#rect_filled-1) * [rect\_filled\_rounded](https://golua.fatality.win/documentation/namespaces/render#rect_filled-2) * [rect\_filled\_multicolor](https://golua.fatality.win/documentation/namespaces/render#rect_filled_multicolor) * [circle\_filled](https://golua.fatality.win/documentation/namespaces/render#circle_filled) * [circle](https://golua.fatality.win/documentation/namespaces/render#circle) * [line](https://golua.fatality.win/documentation/namespaces/render#line) * [line\_multicolor](https://golua.fatality.win/documentation/namespaces/render#line_multicolor) * [triangle\_filled](https://golua.fatality.win/documentation/namespaces/render#triangle_filled) * [triangle](https://golua.fatality.win/documentation/namespaces/render#triangle) * [triangle\_filled\_multicolor](https://golua.fatality.win/documentation/namespaces/render#triangle_filled_multicolor) * [Animations](https://golua.fatality.win/documentation/namespaces/render#animations) * [create\_animator\_float](https://golua.fatality.win/documentation/namespaces/render#create_animator_float) * [create\_animator\_color](https://golua.fatality.win/documentation/namespaces/render#create_animator_color) sun-brightdesktopmoon Copy render.color(255, 255, 255) render.color(255, 255, 255, 100) render.color("#FFFFFF") Copy { r, g, b, a } Copy render.esp_flag("some flag", render.color("#FFFFFF")) Copy render.create_font("smallest_pixel-7.ttf", 11, render.font_flag_outline) Copy render.create_font_gdi("Smallest pixel-7", 11, render.font_flag_outline) Copy render.create_font_stream({0x1, ...}, 12) Copy render.get_text_size(font, "String to measure") Copy render.wrap_text(font, 'This is a really long string!', 250) Copy render.text(font, 10, 10, "this is some centered text", render.color("#FFFFFF"), render.align_center, render.align_center, render.align_left) Copy -- Ex: render.font_gui_main, render.font_esp Copy local shader = render.create_shader([[\ sampler s0;\ \ float4 main(float2 uv: TEXCOORD0): COLOR0\ {\ return tex2D(s0, uv);\ }\ ]]); Copy render.set_shader(shader); Copy render.create_texture("fatality/image.jpg") Copy render.create_texture_bytes(bytes, 20) Copy render.create_texture_rgba(bytes, 100, 100, row_stride) Copy render.create_texture_stream({0x1, 0x5, 0xff}) Copy local svg_data = [[\ \ \ \ ]] render.create_texture_svg(svg_data, 20) -- or render.create_texture_svg("fatality/image.svg", 20) Copy local texture_id = render.create_texture("image.png" render.set_texture(texture_id) Copy -- Ex: render.texture_logo_head, render.texture_avatar Copy render.pop_texture() Copy render.set_uv(0.25, 0.25, 0.75, 0.75) Copy render.pop_uv() Copy render.get_texture_size(texture_id) Copy local framecount = render.get_frame_count(my_gif) Copy local w, h = render.get_screen_size() Copy render.push_clip_rect(10, 10, 110, 110) Copy render.pop_clip_rect() Copy render.rect_filled(10, 10, 110, 110, render.color("#00FFFF")) Copy render.rect(10, 10, 110, 110, render.color("#00FFFF")) Copy render.rect_rounded(10, 10, 110, 110, render.color("#00FFFF"), 1.5, render.top) Copy render.rect_filled_rounded(10, 10, 110, 110, render.color("#00FFFF"), 1.5, render.top) Copy render.rect_filled_multicolor(10, 10, 110, 110, render.color("#FFFFFF"), render.color("#000000"), render.color("#FFFFFF"), render.color("#000000")) Copy render.circle_filled(110, 110, 50, render.color("#FFFFFF")) Copy render.circle(110, 110, 50, render.color("#FFFFFF")) Copy render.line(10, 10, 100, 100, render.color("#FFFFFF")) Copy render.line_multicolor(10, 10, 100, 100, render.color("#FFFFFF"), render.color("#000000")) Copy render.triangle_filled(20, 10, 5, 20, 30, 20, render.color("#FFFFFF")) Copy render.triangle(20, 10, 5, 20, 30, 20, render.color("#FFFFFF")) Copy render.triangle_filled_multicolor(20, 10, 5, 20, 30, 20, render.color("#FF0000"), render.color("#00FF00"), render.color("#0000FF")) Copy render.create_animator_float(0, 5, render.ease_in_out) Copy render.create_animator_color(render.color("FFFFFF"), 5, render.ease_in_out, true) sun-brightdesktopmoon --- # Utilities | Lua API [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#random-values) Random values --------------------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#random_int) random\_int Copy utils.random_int(0, 100) [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) min number minimum number to generate max number maximum number to generate #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) random number number ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#random_float) random\_float Copy utils.random_float(0, 100) [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) min number minimum number to generate max number maximum number to generate #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-1) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) random number number [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#memory) Memory ------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#find_interface) find\_interface [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) module\_name string name of module interface\_name string name of interface followed by its version number #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-2) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) interface address or nil on failure number - nil ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#find_pattern) find\_pattern [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) module\_name string name of module pattern string [IDAarrow-up-right](https://hex-rays.com/ida-pro/) style pattern. ? indicates wildcard #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-3) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) pattern address or nil on failure number - nil ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#flags) flags [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) flag number flags to combine with the [bitwise ORarrow-up-right](https://www.cprogramming.com/tutorial/bitwise_operators.html) operator ... number any other flags [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#timers) Timers ------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#new_timer) new\_timer [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) rate number the rate in which the function will be called (in milliseconds) function\_to\_call function function to be called #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-4) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) timer object [utils.timer](https://golua.fatality.win/documentation/datatypes/timer) ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#run_delayed) run\_delayed [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) delay number the delay to wait before calling the function (in milliseconds) function\_to\_call function function to be called [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#http) HTTP --------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#http_get) http\_get [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) url string url to send the request to headers string [http headersarrow-up-right](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers) function\_to\_call function callback with response ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#http_post) http\_post [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) url string url to send the request to headers string [http headersarrow-up-right](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers) body string post body function\_to\_call function callback with response [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#json) Json --------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#json_decode) json\_decode [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) json\_data string string of json data #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-5) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) json data as lua table table ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#json_encode) json\_encode [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) lua\_table table a lua table to be encoded into json #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-6) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) lua table as a json string string [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#trace-ray) Trace ray ------------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#trace) trace [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) from [math.vec3](https://golua.fatality.win/documentation/datatypes/vec3) starting point to [math.vec3](https://golua.fatality.win/documentation/datatypes/vec3) ending point skip\_index number index to skip or -1 for all players #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-7) Returns [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) trace info [trace\_t](https://golua.fatality.win/documentation/datatypes/trace_t) ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#trace_bullet) trace\_bullet [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) item\_definition\_index number weapon's item definition index to use for tracing from [math.vec3](https://golua.fatality.win/documentation/datatypes/vec3) starting point to [math.vec3](https://golua.fatality.win/documentation/datatypes/vec3) ending point #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-8) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) damage number trace info [trace\_t](https://golua.fatality.win/documentation/datatypes/trace_t) ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#scale_damage) scale\_damage [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) damage number damage to scale item\_definition\_index number weapon's item definition index to use for calculating damage hit\_group number hit group to scale with armor number their armor level heavy\_armor boolean do they have heavy armor helmet boolean do they have a helmet #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-9) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) damage number [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#console) Console --------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#print_console) print\_console [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) [Default value](https://golua.fatality.win/documentation/namespaces/utilities) text string text to print ❌ color [render.color](https://golua.fatality.win/documentation/namespaces/render#color) color white ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#print_dev_console) print\_dev\_console [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) text string text to print ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#error_print) error\_print [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) text string text to print [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#encryption) Encryption --------------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#aes256_encrypt) aes256\_encrypt [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) key string key to also used for decryption data string string to encrypt #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-10) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) encrypted data string ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#aes256_decrypt) aes256\_decrypt [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) key string key to also used for encryption data string encrypted string #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-11) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) data string ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#base64_encode) base64\_encode [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) data string data to encode #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-12) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) encoded data string ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#base64_decode) base64\_decode [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) encoded data string data from base64\_encode #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-13) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) data string [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#miscellaneous) Miscellaneous --------------------------------------------------------------------------------------------------------- ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#load_file) load\_file [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) path string path to file #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-14) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) file\_contents binary string #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#note) Note: Path starts at csgo.exe's file location. ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#get_weapon_info) get\_weapon\_info [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) item\_definition\_index number weapons [item definition index](https://golua.fatality.win/documentation/datatypes/weapon_info#item-definition-indexes) #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-15) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) table with the weapons info [utils.weapon\_info](https://golua.fatality.win/documentation/datatypes/weapon_info) ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#get_rtt) get\_rtt #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-16) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) round trip time to server number ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#world_to_screen) world\_to\_screen [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) x number 3D x world position y number 3D y world position z number 3D z world position #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-17) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) x screen pos or nil on failure number - nil y screen pos or nil on failure number - nil #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#usage) Usage: Converts world coordinates to screen coordinates. ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#set_clan_tag) set\_clan\_tag [Parameter](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) new\_tag string string to set clantag to ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#get_time) get\_time #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-18) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) time information table #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#table-structure) Table structure: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [Description](https://golua.fatality.win/documentation/namespaces/utilities) year number current year month number month (1 - 12) year\_day number day (1 - 366) month\_day number day (1 - 31) week\_day number day (1 - 7) hour number hour (1 - 23) min number minute (1 - 59) sec number second (0 - 60) including leap second ### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#get_unix_time) get\_unix\_time #### [hashtag](https://golua.fatality.win/documentation/namespaces/utilities#returns-19) Returns: [Value](https://golua.fatality.win/documentation/namespaces/utilities) [Datatype](https://golua.fatality.win/documentation/namespaces/utilities) [unix timestamparrow-up-right](https://www.unixtimestamp.com/) number [PreviousMathchevron-left](https://golua.fatality.win/documentation/namespaces/math) [NextEntitieschevron-right](https://golua.fatality.win/documentation/namespaces/entities) Last updated 2 years ago * [Random values](https://golua.fatality.win/documentation/namespaces/utilities#random-values) * [random\_int](https://golua.fatality.win/documentation/namespaces/utilities#random_int) * [random\_float](https://golua.fatality.win/documentation/namespaces/utilities#random_float) * [Memory](https://golua.fatality.win/documentation/namespaces/utilities#memory) * [find\_interface](https://golua.fatality.win/documentation/namespaces/utilities#find_interface) * [find\_pattern](https://golua.fatality.win/documentation/namespaces/utilities#find_pattern) * [flags](https://golua.fatality.win/documentation/namespaces/utilities#flags) * [Timers](https://golua.fatality.win/documentation/namespaces/utilities#timers) * [new\_timer](https://golua.fatality.win/documentation/namespaces/utilities#new_timer) * [run\_delayed](https://golua.fatality.win/documentation/namespaces/utilities#run_delayed) * [HTTP](https://golua.fatality.win/documentation/namespaces/utilities#http) * [http\_get](https://golua.fatality.win/documentation/namespaces/utilities#http_get) * [http\_post](https://golua.fatality.win/documentation/namespaces/utilities#http_post) * [Json](https://golua.fatality.win/documentation/namespaces/utilities#json) * [json\_decode](https://golua.fatality.win/documentation/namespaces/utilities#json_decode) * [json\_encode](https://golua.fatality.win/documentation/namespaces/utilities#json_encode) * [Trace ray](https://golua.fatality.win/documentation/namespaces/utilities#trace-ray) * [trace](https://golua.fatality.win/documentation/namespaces/utilities#trace) * [trace\_bullet](https://golua.fatality.win/documentation/namespaces/utilities#trace_bullet) * [scale\_damage](https://golua.fatality.win/documentation/namespaces/utilities#scale_damage) * [Console](https://golua.fatality.win/documentation/namespaces/utilities#console) * [print\_console](https://golua.fatality.win/documentation/namespaces/utilities#print_console) * [print\_dev\_console](https://golua.fatality.win/documentation/namespaces/utilities#print_dev_console) * [error\_print](https://golua.fatality.win/documentation/namespaces/utilities#error_print) * [Encryption](https://golua.fatality.win/documentation/namespaces/utilities#encryption) * [aes256\_encrypt](https://golua.fatality.win/documentation/namespaces/utilities#aes256_encrypt) * [aes256\_decrypt](https://golua.fatality.win/documentation/namespaces/utilities#aes256_decrypt) * [base64\_encode](https://golua.fatality.win/documentation/namespaces/utilities#base64_encode) * [base64\_decode](https://golua.fatality.win/documentation/namespaces/utilities#base64_decode) * [Miscellaneous](https://golua.fatality.win/documentation/namespaces/utilities#miscellaneous) * [load\_file](https://golua.fatality.win/documentation/namespaces/utilities#load_file) * [get\_weapon\_info](https://golua.fatality.win/documentation/namespaces/utilities#get_weapon_info) * [get\_rtt](https://golua.fatality.win/documentation/namespaces/utilities#get_rtt) * [world\_to\_screen](https://golua.fatality.win/documentation/namespaces/utilities#world_to_screen) * [set\_clan\_tag](https://golua.fatality.win/documentation/namespaces/utilities#set_clan_tag) * [get\_time](https://golua.fatality.win/documentation/namespaces/utilities#get_time) * [get\_unix\_time](https://golua.fatality.win/documentation/namespaces/utilities#get_unix_time) sun-brightdesktopmoon Copy utils.find_interface("client.dll", "VClient018") Copy utils.find_pattern("client.dll", "8B 3D ? ? ? ? 85 FF 74 47") + 2 Copy utils.flags(render.font_flag_outline, render.font_flag_shadow) Copy local timer = utils.new_timer(100, function() print("This will be called every 100ms") end) timer:start() Copy utils.run_delayed(100, function() print("This will be called after 100ms") end) Copy utils.http_get("https://pastebin.com/raw/FT1aRqq8", "Accept: */*", function(response) print(response) end) Copy utils.http_post("https://reqbin.com/echo/post/json", "Content-Type: application/json", [[body: "{"id": 12345,}"]], function(response) print(response) end) Copy local json_data = [[\ {\ "value": 1,\ "color": "pink"\ }\ ]] local json_decoded = utils.json_decode(json_data) Copy local table = { value = 1, color = "pink" } local json_string = utils.json_encode(table) Copy utils.trace(math.vec3(0, 0, 0), math.vec3(100, 100, 100), -1) Copy utils.trace_bullet(7, math.vec3(0, 0, 0), math.vec3(100, 100, 100)) Copy utils.scale_damage(30, 7, 0, player:get_prop("m_ArmorValue"), player:get_prop("m_bHasHeavyArmor"), player:get_prop("m_bHasHelmet")) Copy utils.print_console("red text", render.color("#FF0000")) Copy utils.print_dev_console("text") Copy utils.error_print("error") Copy local encryption = utils.aes256_encrypt("abcdefg", "we woo we woo") Copy local encryption = utils.aes256_encrypt("abcdefg", "we woo we woo") local data = utils.aes256_decrypt("abcdefg", encryption) Copy local encoded = utils.base64_encode("AAAAAAA") Copy local encoded = utils.base64_encode("AAAAAAA") local data = utils.base64_decode(encoded) Copy utils.load_file("path") Copy utils.get_weapon_info(1) Copy utils.get_rtt() Copy local x, y = utils.world_to_screen(0, 0, 100) if x then render.rect_filled(x, y, 1, 1, render.color("#FFFFFF")) end Copy utils.set_clan_tag("fatal") Copy utils.get_time() Copy utils.get_unix_time() sun-brightdesktopmoon --- # Namespaces | Lua API [🖥️Guichevron-right](https://golua.fatality.win/documentation/namespaces/gui) [✏️Renderchevron-right](https://golua.fatality.win/documentation/namespaces/render) [🏎️Enginechevron-right](https://golua.fatality.win/documentation/namespaces/engine) [🔢Mathchevron-right](https://golua.fatality.win/documentation/namespaces/math) [⚙️Utilitieschevron-right](https://golua.fatality.win/documentation/namespaces/utilities) [🙎Entitieschevron-right](https://golua.fatality.win/documentation/namespaces/entities) [📖Databasechevron-right](https://golua.fatality.win/documentation/namespaces/database) [🖱️Inputchevron-right](https://golua.fatality.win/documentation/namespaces/input) [🌌Panoramachevron-right](https://golua.fatality.win/documentation/namespaces/panorama) [🪶Materialschevron-right](https://golua.fatality.win/documentation/namespaces/materials) [📂Filesystemchevron-right](https://golua.fatality.win/documentation/namespaces/filesystem) [🗃️Zipchevron-right](https://golua.fatality.win/documentation/namespaces/zip) [PreviousUseful resourceschevron-left](https://golua.fatality.win/getting-started/useful-resources) [NextGuichevron-right](https://golua.fatality.win/documentation/namespaces/gui) Last updated 2 years ago ---