> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: Environment
icon: globe
sidebar_position: 1
---

# <ApiPageIcon icon="globe" />Environment

<ApiExposes data="[{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;_G&#x22;,&#x22;h&#x22;:&#x22;#_g&#x22;},{&#x22;k&#x22;:&#x22;GLOBALS&#x22;,&#x22;c&#x22;:&#x22;fn&#x22;,&#x22;s&#x22;:&#x22;Functions&#x22;,&#x22;h&#x22;:&#x22;#functions&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;h&#x22;:&#x22;#nil&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;h&#x22;:&#x22;#boolean&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;number&#x22;,&#x22;h&#x22;:&#x22;#number&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;h&#x22;:&#x22;#integer&#x22;},{&#x22;k&#x22;:&#x22;TYPES&#x22;,&#x22;c&#x22;:&#x22;type&#x22;,&#x22;s&#x22;:&#x22;Types&#x22;,&#x22;h&#x22;:&#x22;#types&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;string&#x22;,&#x22;h&#x22;:&#x22;#string&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;userdata&#x22;,&#x22;h&#x22;:&#x22;#userdata&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;function&#x22;,&#x22;h&#x22;:&#x22;#function&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;metatable&#x22;,&#x22;h&#x22;:&#x22;#metatable&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;ScriptPerformance&#x22;,&#x22;h&#x22;:&#x22;#scriptperformance&#x22;}]" />

## \_G<ApiTag label="object type" />

A global variable (not a function) that holds the global environment (that is, `_G._G = _G`).
Lua itself does not use this variable; changing its value does not affect any environment, nor vice-versa.

## Functions<ApiTag label="global functions" />

<ApiMembers>
  <ApiMember kind="fn" name="assert" summary="Issues an error when the value of its argument `v` is false (i.e., **nil** or **false**); otherwise, returns all its arguments. `message` is an error message; when absent, it defaults to &#x22;assertion failed!&#x22;" args="v?, message?, ...?" sig="[{&#x22;s&#x22;:&#x22;assert&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;v&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;message&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;...&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;v&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],&#x22;d&#x22;:&#x22;Value to test.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;message&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Error message used when `v` is false or nil.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;...&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Extra values returned after `v` when the assertion succeeds.&#x22;,&#x22;o&#x22;:true}]" returns="[{&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}]},{&#x22;n&#x22;:&#x22;...&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]}]" />

  <ApiMember kind="fn" name="collectgarbage" summary="This function is a generic interface to the garbage collector. It performs different functions according to its first argument, opt: - **&#x22;collect&#x22;:** performs a full garbage-collection cycle. This is the default option. - **&#x22;stop&#x22;:** This option is ignored, and the collector keeps running. All scripts share one garbage collector, so a script cannot stop it. - **&#x22;restart&#x22;:** restarts the garbage collector. - **&#x22;count&#x22;:** returns the total memory in use by Lua (in Kbytes). - **&#x22;step&#x22;:** performs a garbage-collection step. The step &#x22;size&#x22; is controlled by arg (larger values mean more steps) in a non-specified way. If you want to control the step size you must experimentally tune the value of arg. Returns true if the step finished a collection cycle. - **&#x22;setpause&#x22;:** This option does not change the pause of the collector. It returns the current pause value. - **&#x22;setstepmul&#x22;:** This option does not change the step multiplier of the collector. It returns the current step multiplier." args="opt?, arg?" sig="[{&#x22;s&#x22;:&#x22;collectgarbage&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;opt&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;arg&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;opt&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;arg&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;o&#x22;:true}]">
    <ApiNotes>
      The first time a script uses `"stop"`, `"setpause"` or `"setstepmul"`, a warning is added to the
      Errors list of the script and written to the game console.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="error" summary="Terminates the last protected function called and returns `message` as the error message. Function `error` never returns." args="message, level?" sig="[{&#x22;s&#x22;:&#x22;error&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;message&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;level&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;message&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Error object to raise.&#x22;},{&#x22;n&#x22;:&#x22;level&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;Stack level used to report the error location.&#x22;,&#x22;o&#x22;:true}]">
    <ApiNotes>
      Usually, `error` adds some information about the error position at the beginning of the message.
      The `level` argument specifies how to get the error position.
      With level 1 (the default), the error position is where the `error` function was called.
      Level 2 points the error to where the function that called `error` was called; and so on.
      Passing a level 0 avoids the addition of error position information to the message.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="getmetatable" summary="If `object` does not have a metatable, returns **nil**. Otherwise, if the object's metatable has a `&#x22;__metatable&#x22;` field, returns the associated value. Otherwise, returns the metatable of the given object." args="object" sig="[{&#x22;s&#x22;:&#x22;getmetatable&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;object&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;object&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Value whose metatable is queried.&#x22;}]" returns="[{&#x22;n&#x22;:&#x22;metatable&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}]}]" nodiscard />

  <ApiMember kind="fn" name="ipairs" summary="Returns three values: an iterator function, the table `t`, and 0, so that the construction" args="t" sig="[{&#x22;s&#x22;:&#x22;ipairs&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;i&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;i&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],[{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;t&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],&#x22;d&#x22;:&#x22;Table to iterate.&#x22;}]" returns="[{&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;i&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}]},{&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}]},{&#x22;n&#x22;:&#x22;i&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]}]">
    <ApiNotes>
      for i,v in ipairs(t) do --\[\[body]] end

      will iterate over the pairs (`1,t[1]`), (`2,t[2]`), ···, up to the first integer key absent from the table.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="next" summary="Allows a program to traverse all fields of a table. Its first argument is a table and its second argument is an index in this table. `next` returns the next index of the table and its associated value. When called with **nil** as its second argument, `next` returns an initial index and its associated value. When called with the last index, or with **nil** in an empty table, `next` returns **nil**. If the second argument is absent, then it is interpreted as **nil**. In particular, you can use `next(t)` to check whether a table is empty." args="table, index?" sig="[{&#x22;s&#x22;:&#x22;next&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;K&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;index&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;K&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;K&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;K&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}],[{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;table&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;K&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;}],&#x22;d&#x22;:&#x22;Table being traversed.&#x22;},{&#x22;n&#x22;:&#x22;index&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;K&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],&#x22;d&#x22;:&#x22;Previous key, or `nil` to start traversal.&#x22;,&#x22;o&#x22;:true}]" nodiscard>
    <ApiNotes>
      The order in which the indices are enumerated is not specified, *even for numeric indices*.
      (To traverse a table in numeric order, use a numerical **for** or the `ipairs` function.)

      The behavior of `next` is *undefined* if, during the traversal, you assign any value to a non-existent field in the table.
      You may however modify existing fields. In particular, you may clear existing fields.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="pairs" summary="Returns three values: the `next` function, the table `t`, and **nil**, so that the construction" args="t" sig="[{&#x22;s&#x22;:&#x22;pairs&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;K&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;index&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;K&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;K&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;\u003c&#x22;},{&#x22;s&#x22;:&#x22;K&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;\u003e&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;index&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;K&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;K&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],[{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;t&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;T&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],&#x22;d&#x22;:&#x22;Table to iterate.&#x22;}]">
    <ApiNotes>
      for k,v in pairs(t) do --\[\[body]] end

      will iterate over all key–value pairs of table `t`.

      See function `next` for the caveats of modifying the table during its traversal.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="pcall" summary="Calls function `f` with the given arguments in _protected mode_. This means that any error inside `f` is not propagated; instead, `pcall` catches the error and returns a status code. Its first result is the status code (a boolean), which is true if the call succeeds without errors. In such case, `pcall` also returns all results from the call, after this first result. In case of any error, `pcall` returns **false** plus the error message." args="f, arg1?, ...?" sig="[{&#x22;s&#x22;:&#x22;pcall&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;f&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;unknown&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;arg1&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;...&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;f&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;unknown&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Function to call.&#x22;},{&#x22;n&#x22;:&#x22;arg1&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;First argument passed to `f`.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;...&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Additional arguments passed to `f`.&#x22;,&#x22;o&#x22;:true}]" returns="[{&#x22;n&#x22;:&#x22;success&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]},{&#x22;n&#x22;:&#x22;result&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]},{&#x22;n&#x22;:&#x22;...&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]}]" />

  <ApiMember kind="fn" name="print" summary="The same function as `log.Print`. Converts its arguments to strings, joins them without a separator, and writes them as one line to the game console with the `neverlose ·` prefix. When the Lua Output option of Log Events is enabled in the menu, the line is also added to the event log on the screen. `print` is not intended for formatted output, but only as a quick way to show a value, typically for debugging. For formatted output, use `string.format`." args="...?" sig="[{&#x22;s&#x22;:&#x22;print&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;...&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;...&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Values to print.&#x22;,&#x22;o&#x22;:true}]" />

  <ApiMember kind="fn" name="rawequal" summary="Checks whether `v1` is equal to `v2`, without invoking any metamethod. Returns a boolean." args="v1, v2" sig="[{&#x22;s&#x22;:&#x22;rawequal&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;v1&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;v2&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;v1&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;First value to compare.&#x22;},{&#x22;n&#x22;:&#x22;v2&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Second value to compare.&#x22;}]" nodiscard />

  <ApiMember kind="fn" name="rawget" summary="Gets the real value of `table[index]`, without invoking any metamethod. `table` must be a table; `index` may be any value." args="table, index" sig="[{&#x22;s&#x22;:&#x22;rawget&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;index&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;table&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}],&#x22;d&#x22;:&#x22;Table to read from.&#x22;},{&#x22;n&#x22;:&#x22;index&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Key to read.&#x22;}]" nodiscard />

  <ApiMember kind="fn" name="rawlen" summary="Returns the length of the object `v`, which must be a table or a string, without invoking the `__len` metamethod. Returns an integer." args="v" sig="[{&#x22;s&#x22;:&#x22;rawlen&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;v&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;userdata&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#userdata&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;ffi.cdata&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;*&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;v&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;userdata&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#userdata&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;ffi.cdata&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;*&#x22;}],&#x22;d&#x22;:&#x22;Object to measure.&#x22;}]" returns="[{&#x22;n&#x22;:&#x22;len&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]}]" nodiscard />

  <ApiMember kind="fn" name="rawset" summary="Sets the real value of `table[index]` to `value`, without invoking any metamethod. `table` must be a table, `index` any value different from **nil**, and `value` any Lua value." args="table, index, value" sig="[{&#x22;s&#x22;:&#x22;rawset&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;index&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;value&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;table&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}],&#x22;d&#x22;:&#x22;Table to modify.&#x22;},{&#x22;n&#x22;:&#x22;index&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Key to assign.&#x22;},{&#x22;n&#x22;:&#x22;value&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Value to store.&#x22;}]">
    <ApiNotes>
      This function returns `table`.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="require" summary="Returns the module with the name `modname`. The name can be one of the following." args="modname" sig="[{&#x22;s&#x22;:&#x22;require&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;modname&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;unknown&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;unknown&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;modname&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;Module name to load.&#x22;}]">
    <ApiNotes>
      The name of a module from the `requirements` section of `extension.json`, such as `ffi`,
      `neverlose/name` or `local/name`. These modules are loaded before the script runs, and
      `require` returns the loaded module. If the module is not listed in the requirements,
      `require` throws an error.

      The name of a standard library, which is `math`, `bit`, `string`, `jit`, `table`, `coroutine`,
      `json` or `msgpack`. `require` returns the copy of the library that the script uses.

      The path of a Lua file of the script, without the `.lua` extension. The file runs the first
      time it is required. Later calls return the same result without running the file again.

      `table.new` or `table.clear`.

      If no module has this name, or if the module throws an error while it loads, `require` throws
      an error.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="select" summary="If `index` is a number, returns all arguments after argument number `index`. Otherwise, `index` must be the string `&#x22;#&#x22;`, and `select` returns the total number of extra arguments it received." args="index, ...?" sig="[{&#x22;s&#x22;:&#x22;select&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;index&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;#&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;...&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;index&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;#&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;}],&#x22;d&#x22;:&#x22;Argument index to select, or \&#x22;#\&#x22; to count arguments.&#x22;},{&#x22;n&#x22;:&#x22;...&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Values to select from.&#x22;,&#x22;o&#x22;:true}]" nodiscard />

  <ApiMember kind="fn" name="setmetatable" summary="Sets the metatable for the given table. (You cannot change the metatable of other types from Lua, only from C.) If `metatable` is **nil**, removes the metatable of the given table. If the original metatable has a `&#x22;__metatable&#x22;` field, raises an error." args="table, metatable?" sig="[{&#x22;s&#x22;:&#x22;setmetatable&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;metatable&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;metatable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#metatable&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;table&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}],&#x22;d&#x22;:&#x22;Table to update.&#x22;},{&#x22;n&#x22;:&#x22;metatable&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;metatable&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#metatable&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}],&#x22;d&#x22;:&#x22;New metatable, or nil to remove it.&#x22;,&#x22;o&#x22;:true}]">
    <ApiNotes>
      This function returns `table`.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="tonumber" summary="Tries to convert its argument to a number. If the argument is already a number or a string convertible to a number, then `tonumber` returns this number; otherwise, it returns **nil**." args="e" sig="[{&#x22;s&#x22;:&#x22;tonumber&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;e&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;e&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Value to convert.&#x22;}]" nodiscard>
    <ApiNotes>
      An optional argument specifies the base to interpret the numeral.
      The base may be any integer between 2 and 36, inclusive.
      In bases above 10, the letter '`A`' (in either upper or lower case) represents 10, '`B`' represents 11, and so forth, with '`Z`' representing 35.
      In base 10 (the default), the number can have a decimal part, as well as an optional exponent part.
      In other bases, only unsigned integers are accepted.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="tostring" summary="Receives an argument of any type and converts it to a string in a reasonable format. For complete control of how numbers are converted, use `string.format`." args="v" sig="[{&#x22;s&#x22;:&#x22;tostring&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;v&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;v&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Value to convert.&#x22;}]" nodiscard>
    <ApiNotes>
      If the metatable of `e` has a `"__tostring"` field, then `tostring` calls the corresponding value with `e` as argument, and uses the result of the call as its result.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="xpcall" summary="This function is similar to `pcall`, except that you can set a new error handler." args="f, msgh, arg1?, ...?" sig="[{&#x22;s&#x22;:&#x22;xpcall&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;f&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;unknown&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;msgh&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;function&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#function&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;arg1&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;...&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;f&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;unknown&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Function to call.&#x22;},{&#x22;n&#x22;:&#x22;msgh&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;function&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#function&#x22;}],&#x22;d&#x22;:&#x22;Error handler called with the error object.&#x22;},{&#x22;n&#x22;:&#x22;arg1&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;First argument passed to `f`.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;...&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Additional arguments passed to `f`.&#x22;,&#x22;o&#x22;:true}]" returns="[{&#x22;n&#x22;:&#x22;success&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]},{&#x22;n&#x22;:&#x22;result&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]},{&#x22;n&#x22;:&#x22;...&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}]}]">
    <ApiNotes>
      `xpcall` calls function `f` in protected mode, using `err` as the error handler.
      Any error inside `f` is not propagated; instead, `xpcall` catches the error, calls the `err` function with the original error object, and returns a status code.
      Its first result is the status code (a boolean), which is true if the call succeeds without errors.
      In this case, `xpcall` also returns all results from the call, after this first result.
      In case of any error, `xpcall` returns **false** plus the result from `err`.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="unpack" summary="Returns the elements from the given table. This function is equivalent to" args="list, i?, j?" sig="[{&#x22;s&#x22;:&#x22;unpack&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;list&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;i&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;j&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;T1&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;T2&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;T3&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;T4&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;T5&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;T6&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;T7&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;T8&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;T9&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;T10&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;T1&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],[{&#x22;s&#x22;:&#x22;T2&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],[{&#x22;s&#x22;:&#x22;T3&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],[{&#x22;s&#x22;:&#x22;T4&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],[{&#x22;s&#x22;:&#x22;T5&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],[{&#x22;s&#x22;:&#x22;T6&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],[{&#x22;s&#x22;:&#x22;T7&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],[{&#x22;s&#x22;:&#x22;T8&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],[{&#x22;s&#x22;:&#x22;T9&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}],[{&#x22;s&#x22;:&#x22;T10&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;list&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;}]},{&#x22;n&#x22;:&#x22;i&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;First index to unpack.&#x22;,&#x22;o&#x22;:true},{&#x22;n&#x22;:&#x22;j&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;Last index to unpack.&#x22;,&#x22;o&#x22;:true}]" nodiscard>
    <ApiNotes>
      return list\[i], list\[i+1], ···, list\[j]

      except that the above code can be written only for a fixed number of elements.
      By default, `i` is 1 and `j` is the length of the list, as defined by the length operator.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="type" summary="Returns the type of its only argument, coded as a string. The possible results of this function are &#x22;`nil`&#x22; (a string, not the value **nil**), &#x22;`number`&#x22;, &#x22;`string`&#x22;, &#x22;`boolean`&#x22;, &#x22;`table`&#x22;, &#x22;`function`&#x22;, &#x22;`thread`&#x22;, &#x22;`userdata`&#x22;, and &#x22;`cdata`&#x22;." args="v" sig="[{&#x22;s&#x22;:&#x22;type&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;v&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;cdata&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;function&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;number&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;thread&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;},{&#x22;s&#x22;:&#x22;userdata&#x22;},{&#x22;s&#x22;:&#x22;\&#x22;&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;v&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;Value to inspect.&#x22;}]" nodiscard>
    <ApiNotes>
      There are nine basic types in LuaJIT: *nil*, *boolean*, *number*, *string*, *function*, *userdata*, *thread*, *table*, and *cdata*.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="inext" summary="The iterator function that `ipairs` returns. It walks the array part of a table, in the same way as `next` walks all keys." args="table, index?" sig="[{&#x22;s&#x22;:&#x22;inext&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;table&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;index&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],[{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;table&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;V&#x22;,&#x22;k&#x22;:&#x22;generic&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}],&#x22;d&#x22;:&#x22;The table to iterate over.&#x22;},{&#x22;n&#x22;:&#x22;index&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;The previous index. Pass `0` to start at index `1`. If no number is given, the function throws an error.&#x22;,&#x22;o&#x22;:true}]" nodiscard>
    <ApiNotes>
      Given a table and an index `i`, it returns `i + 1` and the value at index `i + 1`. When that
      value is **nil**, it returns nothing and the loop ends. `for i, v in inext, t, 0 do end` works
      in the same way as `for i, v in ipairs(t) do end`.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="defer" summary="Registers a cleanup function for the current script. The arguments are passed to the function exactly as given, including **nil** values at the end." args="callback, ...?" sig="[{&#x22;s&#x22;:&#x22;defer&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;callback&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;function&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#function&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;...&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;callback&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;function&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#function&#x22;}],&#x22;d&#x22;:&#x22;The cleanup function. It must be a function. Tables with a `__call` metamethod and other values are not accepted.&#x22;},{&#x22;n&#x22;:&#x22;...&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;The arguments to pass to the cleanup function.&#x22;,&#x22;o&#x22;:true}]">
    <ApiNotes>
      The cleanup functions run when the script is unloaded, reloaded, or fails to start. They run
      after the `shutdown` callbacks and before the resources of the script are released. The last
      function registered runs first. If one function throws an error, the error is logged and the
      other functions still run.

      If a module fails to load, the cleanup functions that it registered run at once. Functions
      that are registered while the script is already cleaning up are ignored.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="traceback" summary="Builds a stack traceback for the place where it is called, with `message` in front of it. Use it as the message handler of `xpcall`. The handler runs inside the failing call, so it can still see the stack of that call." args="message?" sig="[{&#x22;s&#x22;:&#x22;traceback&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;message&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;message&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The text to put in front of the traceback.&#x22;,&#x22;o&#x22;:true}]" returns="[{&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The message and the traceback. Each frame is on its own line and starts with a tab.&#x22;}]">
    <ApiNotes>
      Each frame names its file in the form `My Script/main.lua:12`. A file that comes from a
      dependency is named after the dependency, for example `local/bar/util.lua:5`.

      Deep stacks are shortened. The first 12 frames and the last 10 frames are kept, and a line
      such as `... 30 more frames` replaces the frames between them.

      If `message` already has a traceback in it, it is returned unchanged. If `message` is not a
      string, for example a table or **nil**, it is returned unchanged. If you call `traceback` with
      no arguments, the result is only the traceback.

      Only developer scripts have this function. Market scripts do not have it.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="perf" summary="Returns how much time and memory the code of this script used in the last measuring window. These are the numbers that the scripts list shows. A window is about one second long." args="" sig="[{&#x22;s&#x22;:&#x22;perf&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;ScriptPerformance&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#scriptperformance&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;ScriptPerformance&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#scriptperformance&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" returns="[{&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;ScriptPerformance&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#scriptperformance&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}],&#x22;d&#x22;:&#x22;The values of the last window, or `nil` if no window has ended yet.&#x22;}]">
    <ApiNotes>
      The values are totals for the whole window. They are not values per second. Divide a total
      by `window_ms` to get a rate. The values change only when a new window ends. Use `window` to
      tell one window from the next.

      `freed_kb` is the memory that was released while the code of this script ran. Most of it is
      released by the garbage collector, and it can include garbage of other scripts. When
      `freed_kb` is high, part of `self_ms` is time that the garbage collector used.

      Returns `nil` until the first window has ended. Only developer scripts have this function,
      in the same way as `traceback`.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="printf" summary="Formats a message with `string.format` and passes the result to `print`." args="text, ...?" sig="[{&#x22;s&#x22;:&#x22;printf&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;text&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;...&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;text&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;}],&#x22;d&#x22;:&#x22;The format string. It follows the rules of `string.format`.&#x22;},{&#x22;n&#x22;:&#x22;...&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;}],&#x22;d&#x22;:&#x22;The values to put into the format string.&#x22;,&#x22;o&#x22;:true}]" />

  <ApiMember kind="fn" name="toticks" summary="Converts a time in seconds to a number of ticks. There are 64 ticks in one second." args="time" sig="[{&#x22;s&#x22;:&#x22;toticks&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;time&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;time&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;d&#x22;:&#x22;The time in seconds.&#x22;}]" nodiscard>
    <ApiNotes>
      The result is rounded in the same way as the engine's `TIME_TO_TICKS` macro. Half a tick is
      added to the value, and then the fractional part is removed, rounding toward zero.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="fn" name="totime" summary="Converts a number of ticks to a time in seconds. There are 64 ticks in one second." args="ticks" sig="[{&#x22;s&#x22;:&#x22;totime&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;ticks&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;ticks&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;d&#x22;:&#x22;The number of ticks.&#x22;}]" nodiscard />
</ApiMembers>

## nil<ApiTag label="object type" />

*Nil* is the type of the value **nil**, whose main property is to be different from any other value; it usually represents the absence of a useful value.

## boolean<ApiTag label="object type" />

*Boolean* is the type of the values **false** and **true**.
Both **nil** and **false** make a condition false; any other value makes it true.

## number<ApiTag label="object type" />

*Number* represents real (double-precision floating-point) numbers.

## integer<ApiTag label="object type" />

<ApiSymbol inherits="[{&#x22;n&#x22;:&#x22;number&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]" />

*Integer* isn't an actual Lua type, but it can either mean an integer Lua `number` or LuaJIT `cdata` 64-bit integer, i.e. `cdata<int64_t>`/`cdata<uint64_t>`.

## Types<ApiTag label="types" />

<ApiMembers>
  <ApiMember kind="type" name="int64_t" summary="A signed 64-bit integer. Values that exceed the range of a Lua `number` are represented as a boxed `cdata<int64_t>` rather than a plain `number`, so full 64-bit precision is preserved. Can be declared using the `LL` suffix, which stands for `long long`." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="type" name="uint64_t" summary="An unsigned 64-bit integer. Values that exceed the range of a Lua `number` are represented as a boxed `cdata<uint64_t>` rather than a plain `number`, so full 64-bit precision is preserved. Can be declared using the `ULL` suffix, which stands for `unsigned long long`." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />
</ApiMembers>

## string<ApiTag label="object type" />

*String* represents arrays of characters.
Lua is 8-bit clean: strings can contain any 8-bit character, including embedded zeros ('`\0`')

## userdata<ApiTag label="object type" />

The type *userdata* is provided to allow arbitrary C data to be stored in Lua variables.
This type corresponds to a block of raw memory and has no pre-defined operations in Lua, except assignment and identity test.
However, by using *metatables*, the programmer can define operations for userdata values.
Userdata values cannot be created or modified in Lua, only through the C API.
This guarantees the integrity of data owned by the host program.

Use `ffi.cast` to convert a userdata value to a pointer type. Do this to work with an
address returned by a pattern search or an interface lookup.

## function<ApiTag label="object type" />

A callable Lua function or C function exposed to Lua.

## metatable<ApiTag label="object type" />

Metatable fields that customize operations on Lua values.

`__gc` runs for userdata and cdata only, never for tables.

<ApiMembers>
  <ApiMember kind="prop" name="metatable.__add" summary="Handles addition." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t1&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;t2&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__call" summary="Handles calls on non-function values." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;.&#x22;},{&#x22;s&#x22;:&#x22;unknown&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__concat" summary="Handles concatenation." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t1&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;t2&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__div" summary="Handles division." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t1&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;t2&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__eq" summary="Handles equality comparison." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t1&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;t2&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__gc" summary="Finalizer called when userdata is collected." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__index" summary="Handles reads for missing keys." ret="[[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;k&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__le" summary="Handles less-than-or-equal comparison." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t1&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;t2&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__len" summary="Handles the length operator." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__lt" summary="Handles less-than comparison." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t1&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;t2&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__metatable" summary="Value returned by `getmetatable` and used to protect the metatable." ret="[[{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__mod" summary="Handles modulo." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t1&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;t2&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__mode" summary="Weak table mode for values, keys, or both." ret="[[{&#x22;s&#x22;:&#x22;\u0027&#x22;},{&#x22;s&#x22;:&#x22;v&#x22;},{&#x22;s&#x22;:&#x22;\u0027&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;\u0027&#x22;},{&#x22;s&#x22;:&#x22;k&#x22;},{&#x22;s&#x22;:&#x22;\u0027&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;\u0027&#x22;},{&#x22;s&#x22;:&#x22;kv&#x22;},{&#x22;s&#x22;:&#x22;\u0027&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__mul" summary="Handles multiplication." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t1&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;t2&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__newindex" summary="Handles writes to missing keys." ret="[[{&#x22;s&#x22;:&#x22;table&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/table#table-1&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;k&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;v&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__pow" summary="Handles exponentiation." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t1&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;t2&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__sub" summary="Handles subtraction." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t1&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;,&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;t2&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__tostring" summary="Called by `tostring` to produce a string representation." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />

  <ApiMember kind="prop" name="metatable.__unm" summary="Handles unary minus." ret="[[{&#x22;s&#x22;:&#x22;fun&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;t&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22;any&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;nil&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#nil&#x22;}]]" />
</ApiMembers>

## ScriptPerformance<ApiTag label="object type" />

The table that `perf` returns.

<ApiMembers>
  <ApiMember kind="prop" name="ScriptPerformance.alloc_kb" summary="The memory that the code of this script allocated during the window, in KB. Memory that was freed is not subtracted." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="ScriptPerformance.calls" summary="The number of callbacks that ran during the window." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="ScriptPerformance.freed_kb" summary="The memory that was freed while the code of this script ran, in KB. Most of it is freed by the garbage collector." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="ScriptPerformance.load_ms" summary="The time that `main.lua` took the last time it ran, in milliseconds. It is not part of the window." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="ScriptPerformance.long_calls" summary="The number of calls whose own code took 50 ms or more. The player sees each of these calls as a frozen frame." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="ScriptPerformance.max_ms" summary="The time of the longest single call, in milliseconds. Only the code of this script is counted." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="ScriptPerformance.self_ms" summary="The time spent in the code of this script during the window, in milliseconds." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="ScriptPerformance.share" summary="`self_ms` divided by the real length of the window. The value is from 0 to 1." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="ScriptPerformance.total_ms" summary="The same as `self_ms`, plus the time spent in code of other scripts that this script called, in milliseconds." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="ScriptPerformance.window" summary="A number that changes each time a new window ends." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="ScriptPerformance.window_ms" summary="The real length of the window, in milliseconds." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="ScriptPerformance.worst_event" summary="The event that the longest call ran for, such as `&#x22;render&#x22;`. It is `nil` if there were no calls." ret="[[{&#x22;s&#x22;:&#x22;string&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#string&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />
</ApiMembers>
