> For the complete documentation index, see [llms.txt](https://lua2.fatality.win/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lua2.fatality.win/api/instances/entities.md).

# entities

This table represents an internal entity list.

{% hint style="danger" %}
Never store any entities in the global scope! Any entity might get deleted, and you will no longer have a valid instance of that entity, which will inevitably lead to a crash. If you need to globally store an entity somewhere, we strongly recommend you store an instance of [`CHandle`](/api/instances/entities/chandle.md), and use it's [`Get`](/api/instances/entities/chandle.md#get-1) method to retrieve the entity again, when needed.
{% endhint %}

## players﻿ <a href="#players" id="players"></a>

[<kbd><mark style="background-color:purple;">**Field**<mark style="background-color:purple;"></kbd>](#user-content-fn-1)[^1]

Type: [`EntityList_t`](/api/instances/entities/entitylist_t.md)`<`[`C_CSPlayerPawn`](/api/instances/entities/c_baseentity/c_csplayerpawn.md)`>`

Player pawns.

***

## controllers﻿ <a href="#controllers" id="controllers"></a>

[<kbd><mark style="background-color:purple;">**Field**<mark style="background-color:purple;"></kbd>](#user-content-fn-1)[^1]

Type: [`EntityList_t`](/api/instances/entities/entitylist_t.md)`<`[`C_CSPlayerController`](/api/instances/entities/c_baseentity/c_csplayercontroller.md)`>`

Player controllers.

***

## items﻿ <a href="#items" id="items"></a>

[<kbd><mark style="background-color:purple;">**Field**<mark style="background-color:purple;"></kbd>](#user-content-fn-1)[^1]

Type: [`EntityList_`](/api/instances/entities/entitylist_t.md)`<`[`C_CSWeaponBase`](/api/instances/entities/c_baseentity/c_csweaponbase.md)`>`

Items (held).

***

## droppedItems <a href="#dropped-items" id="dropped-items"></a>

[<kbd><mark style="background-color:purple;">**Field**<mark style="background-color:purple;"></kbd>](#user-content-fn-1)[^1]

Type: [`EntityList_`](/api/instances/entities/entitylist_t.md)`<`[`CBaseAnimGraph`](/api/instances/entities/c_baseentity/cbaseanimgraph.md)`>`

Dropped items.

***

## projectiles﻿ <a href="#projectiles" id="projectiles"></a>

[<kbd><mark style="background-color:purple;">**Field**<mark style="background-color:purple;"></kbd>](#user-content-fn-1)[^1]

Type: [`EntityList_`](/api/instances/entities/entitylist_t.md)`<`[`C_BaseCSGrenadeProjectile`](/api/instances/entities/c_baseentity/c_basecsgrenadeprojectile.md)`>`

Grenade projectiles.

***

## GetLocalPawn

[<kbd><mark style="background-color:purple;">**Function**<mark style="background-color:purple;"></kbd>](#user-content-fn-2)[^2]

Returns the local player's pawn.

**Arguments**

None.

**Returns**

| Type                                                                       | Description |
| -------------------------------------------------------------------------- | ----------- |
| [`C_CSPlayerPawn`](/api/instances/entities/c_baseentity/c_csplayerpawn.md) | Pawn.       |

**Example**

```lua
local lp = entities.GetLocalPawn();
```

***

## GetLocalController

[<kbd><mark style="background-color:purple;">**Function**<mark style="background-color:purple;"></kbd>](#user-content-fn-2)[^2]

Returns the local player's controller.

**Arguments**

None.

**Returns**

| Type                                                                                   | Description |
| -------------------------------------------------------------------------------------- | ----------- |
| [`C_CSPlayerController`](/api/instances/entities/c_baseentity/c_csplayercontroller.md) | Controller. |

**Example**

```lua
local lp_ctrl = entities.GetLocalController();
```

[^1]: This field is a regular field that must be accessed using a dot (.)

[^2]: This field is a function and must be invoked using a dot (.)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://lua2.fatality.win/api/instances/entities.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
