> For the complete documentation index, see [llms.txt](https://docs.kojascripts.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kojascripts.eu/koja-lib/api-reference/client-api/player.md).

# Player

Functions for reading the local player's data on the client side.

## GetPlayerData

Returns the full player data object from the active framework.

```lua
local data = KOJA.Client.GetPlayerData()
```

**Returns** `table` — the framework's player data object.

{% hint style="info" %}
The structure depends on the framework. For ESX this is `ESX.GetPlayerData()`, for QBCore this is `QBCore.Functions.GetPlayerData()`.
{% endhint %}

**Example**

```lua
local data = KOJA.Client.GetPlayerData()
print(data.job.name)
```

## GetPlayerJob

Returns the name of the player's current job.

```lua
local job = KOJA.Client.GetPlayerJob()
```

**Returns** `string | nil`

**Example**

```lua
local job = KOJA.Client.GetPlayerJob()
if job == 'police' then
    -- player is a cop
end
```

## GetPlayerJobLabel

Returns the display label of the player's current job.

```lua
local label = KOJA.Client.GetPlayerJobLabel()
```

**Returns** `string | nil`

**Example**

```lua
local label = KOJA.Client.GetPlayerJobLabel()
print('Job:', label)  -- e.g. "Police Department"
```

## IsDead

Returns whether the local player is dead.

```lua
local dead = KOJA.Client.IsDead()
```

**Returns** `boolean`

**Example**

```lua
if KOJA.Client.IsDead() then
    return
end
```


---

# 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:

```
GET https://docs.kojascripts.eu/koja-lib/api-reference/client-api/player.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
