# okokSpawnSelector

[**YouTube Video**](https://www.youtube.com/watch?v=TFCxQDH0F9Q)

## Installation Guide

### Requirements

ox\_lib **v3.16.2+** (<https://github.com/overextended/ox_lib/releases/latest/download/ox_lib.zip>).

### Event to open the menu

{% tabs %}
{% tab title="Client" %}

```lua
TriggerEvent('okokSpawnSelector:spawnMenu', newCharacter, lastCoords)
```

{% endtab %}

{% tab title="Server" %}

```lua
TriggerClientEvent('okokSpawnSelector:spawnMenu', source, newCharacter, lastCoords)
```

{% endtab %}
{% endtabs %}

**newCharacter** should be true or false.

**lastCoords** is optional and it's used to pass the last location of the player (format example: `{"x":936.40,"y":59.09,"z":111.03}`).

### vSync compatibility

Add the following line at the end of the **vSync/vs\_server.lua** file:

```lua
exports('getWeatherState', function() return CurrentWeather end)
```

### Server artifacts

Make sure your server artifacts version is above the **5181**.

* Windows: <https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/>
* Linux: <https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/>


---

# Agent Instructions: 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.okokscripts.io/scripts/okokspawnselector.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.
