> For the complete documentation index, see [llms.txt](https://horizon-scripts.gitbook.io/horizon-scripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://horizon-scripts.gitbook.io/horizon-scripts-docs/horizonmdt/client-exports.md). Agents can also search and read this documentation through its [MCP server](https://horizon-scripts.gitbook.io/horizon-scripts-docs/~gitbook/mcp).

# Client exports

Call these exports from client-side resources using `exports['HorizonMDT']:ExportName(...)`. They control local tablet UI and related client features; they do not grant server-side permissions.

## Client exports

Call these from another client resource with `exports['HorizonMDT']:...`.

| Export                                                     | Arguments / behavior                                                                                                                                                                                   |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `RequestOpenTablet()`                                      | Recommended opener; asks the server to validate tablet access before opening. No return value.                                                                                                         |
| `openTablet()`                                             | Legacy item-use alias; also requests server validation.                                                                                                                                                |
| `OpenTablet()`                                             | Opens through the normal bootstrap callback, which still checks access.                                                                                                                                |
| `CloseTablet()` / `IsTabletOpen()` / `GetTabletState()`    | Closes or inspects the local tablet UI. `IsTabletOpen()` returns a boolean; `GetTabletState()` returns `{ open, visible, display }`.                                                                   |
| `OpenExternalTablet(displayName, callback, accessContext)` | Opens UI for an external display via the normal server bootstrap. Callback receives `success, response`. `accessContext` is passed to the configured access validator and is not itself authorization. |
| `CloseExternalTablet(displayName, preserveUi)`             | Closes the matching external display; optional preserve flag controls local UI state.                                                                                                                  |
| `StopTabletAnimation()`                                    | Stops the local handheld tablet animation.                                                                                                                                                             |
| `IsJailed()` / `GetJailSpawn()` / `GetRemainingSentence()` | Returns local synced jail state, spawn `{x,y,z,w}` or nil, and remaining sentence seconds.                                                                                                             |
| `OpenBiometricScanner(targetServerId)`                     | Requests the built-in client scanner for a target server ID. Server-side scanner rules still apply.                                                                                                    |
| `UseDashLaptop()`                                          | Requests the vehicle laptop action; the server validates the action/context. No direct result.                                                                                                         |
| `PlayLocalSound(payload)` / `StopLocalSound(soundId)`      | Plays/stops local audio and returns a sound ID or success result.                                                                                                                                      |

Client UI exports do not grant server-side permissions. Prefer `RequestOpenTablet()` for integrations that need a regular tablet.

## Compatibility

The public API works with ESX, QB-Core and Qbox through HorizonMDT's framework adapter. A custom framework needs a working adapter. Framework and inventory selection remain independent. Keep the resource name `HorizonMDT` in export calls unless the calling resource explicitly supports configuring it.

## Custom HUD visibility

A HUD resource can hide its overlays while HorizonMDT is open and restore its own previous visibility state when the tablet closes. This is a client-side integration and covers the native tablet and external/3D displays.

```lua
local tablet = exports['HorizonMDT']:GetTabletState()
setCustomHudVisible(not tablet.open)

AddEventHandler('police_tablet:client:tabletVisibilityChanged', function(state)
    setCustomHudVisible(state.open ~= true)
end)
```

The event payload contains `open`, `visible`, and `display`. `display` is `native`, the external display name, or `closed`. The HUD should preserve its own prior enabled/disabled setting and restore that value when `state.open` becomes `false`.
