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