> For the complete documentation index, see [llms.txt](https://inside-scripts.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://inside-scripts.gitbook.io/documentation/free-scripts/bridge-and-library/functions/library/entity/server.md).

# Server

## <mark style="color:green;">getNearbyPlayers</mark>

### Usage

```lua
Lib.getNearbyPlayers(coords, maxDistance)
```

* coords: `vector3`
* maxDistance: `float`
  * default: `10.0`

### Example

```lua
Lib.getNearbyPlayers(vector3(0.0, 0.0, 0.0), 15.0)
```

* return: `array`
  * id: `number`

## <mark style="color:green;">setEntityStateBag</mark>

### Usage

```lua
Lib.setEntityStateBag(netId, key, value)
```

netId: `number`

key: `string`

value: `any`

### Example

```lua
local playerPed = GetPlayerPed(source)

if playerPed then
    Lib.setEntityStateBag(NetworkGetNetworkIdFromEntity(playerPed), playerExist, true)
end
```
