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

---
title: Global Variables
icon: hourglass
sidebar_position: 2
---

# <ApiPageIcon icon="hourglass" />Global Variables

## globals<ApiTag label="global table" />

Global engine variables for timing and tick state.

If there is no network game client, every field returns nil and assignments do nothing.
Assigning a value to `tickinterval` while there is a network game client throws an error.

<ApiMembers>
  <ApiMember kind="prop" name="globals.absoluteframetime" summary="The render frame time without `host_timescale` and without the server and replay multipliers." 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;}]]" />

  <ApiMember kind="prop" name="globals.curtime" summary="The current time of the main world simulation, equal to the server tick multiplied by `tickinterval`. The value is correct only during simulation." 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;}]]" />

  <ApiMember kind="prop" name="globals.framecount" summary="The number of frames since the game started. It increases every frame, also while the game is paused." 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;?&#x22;}]]" />

  <ApiMember kind="prop" name="globals.frametime" summary="The time of the last server or client frame. This is the time that must be simulated." 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;}]]" />

  <ApiMember kind="prop" name="globals.in_simulation" summary="True in the simulation stage, and false in the rendering stage." 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;?&#x22;}]]" />

  <ApiMember kind="prop" name="globals.interpolation_amount" summary="The part of the tick that is not complete in this frame, from 0 to 1. The value is correct only in the rendering stage, when `in_simulation` is false." 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;}]]" />

  <ApiMember kind="prop" name="globals.interpolation_amount_prediction" summary="The part of the input tick that is not complete in this frame, from 0 to 1. The value is correct only in the rendering stage, when `in_simulation` is false." 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;}]]" />

  <ApiMember kind="prop" name="globals.maxplayers" summary="The maximum number of players that the server allows. This is the number of controllers." 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;?&#x22;}]]" />

  <ApiMember kind="prop" name="globals.realtime" summary="The time in seconds since the game started. Do not use it to measure short times between frames." 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;}]]" />

  <ApiMember kind="prop" name="globals.sim_ticks_this_frame_index" summary="The index of the tick that is simulated now in this 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;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="globals.sim_ticks_this_frame_total" summary="The total number of ticks that are simulated in this 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;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="globals.tickcount" summary="The number of main world simulation ticks. It increases also while the game is paused." 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;?&#x22;}]]" />

  <ApiMember kind="prop" name="globals.tickinterval" summary="The length of one tick in seconds. Read-only." 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;}]]" />

  <ApiMember kind="prop" name="globals.unfilteredframetime" summary="The render frame time without the minimum and maximum limits." 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;}]]" />
</ApiMembers>
