> For the complete documentation index, see [llms.txt](https://grp-development.gitbook.io/solid-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://grp-development.gitbook.io/solid-scripts/resources/solid-spawn/exports-and-events.md).

# Exports and events

Open the spawn selector from your own multicharacter or scripts.

#### Client exports

| Export       | What it does                                                                                                                                       |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `open(info)` | Opens the spawn selector. `info` is `{ isNew = true or false, citizenid = '...' }`. Returns `true` when it starts, `false` when it is already open |
| `IsOpen()`   | `true` while the spawn selector is open                                                                                                            |

```lua
exports['solid-spawn']:open({ isNew = false, citizenid = citizenid })
```

* **A loaded character is needed:** the server only sends spawns for the player's loaded character
* **Nothing to pick:** the player appears at `Config.Fallback`
* **`isNew = true`:** no Last location, and the starter apartments when `qb-apartments` hands them out

#### qb-spawn events

SOLID Spawn answers the events other multicharacter scripts already send to `qb-spawn`.

| Event                                     | What it does                                         |
| ----------------------------------------- | ---------------------------------------------------- |
| `qb-spawn:client:setupSpawns(cData, new)` | Opens the selector, `new = true` for a new character |
| `qb-spawn:client:openUI(true)`            | Opens the selector, `false` is ignored               |

```lua
TriggerEvent('qb-spawn:client:setupSpawns', cData, false)
TriggerEvent('qb-spawn:client:openUI', true)
```

#### After the spawn

SOLID Spawn fires your framework's loaded events through `solid-bridge`, so other scripts start as normal:

* `QBCore:Server:OnPlayerLoaded`
* `QBCore:Client:OnPlayerLoaded`

With [SOLID Multichar](https://grp-development.gitbook.io/solid-scripts/resources/solid-multichar), all of this happens by itself.
