Skip to Content
TabletScript integrationClient exports

Client Exports

Callbacks

TriggerCallback

---@param event string ---@param cb fun(...): any exports["lb-tablet"]:TriggerCallback(event, cb)

AwaitCallback

---@param event string ---@return ... exports["lb-tablet"]:AwaitCallback(event)

RegisterClientCallback

---@param event string ---@param handler fun(...) : ...any exports["lb-tablet"]:RegisterClientCallback(event, handler)

Tablet

FactoryReset

exports["lb-tablet"]:FactoryReset()

ToggleDisabled

---@param disabled boolean exports["lb-tablet"]:ToggleDisabled(disabled)

ToggleOpen

---@param open? boolean # Whether to open or close the tablet. If nil, it will toggle. ---@param unlock? boolean # Whether to unlock the tablet after toggling it open. exports["lb-tablet"]:ToggleOpen(open?, unlock?)

IsOpen

Check if the tablet is open

---@return boolean exports["lb-tablet"]:IsOpen()

ToggleFlashlight

---@param enabled boolean exports["lb-tablet"]:ToggleFlashlight(enabled)

SendNotification

Types

---@class NewNotification ---@field app string ---@field id? number | string ---@field tabletId? string ---@field source? number ---@field title string ---@field content? string ---@field thumbnail? string ---@field avatar? string ---@field showAvatar? boolean ---@field customData? CustomNotificationData ---@field dontSaveToDatabase? boolean ---@class CustomNotificationData ---@field buttons? NotificationButton[] ---@class NotificationButton ---@field title string ---@field event? string ---@field server? boolean ---@field data any
---@param data NewNotification exports["lb-tablet"]:SendNotification(data)

Components

SetPopUp

Types

---@class PopUpData ---@field id? number ---@field title string ---@field description string ---@field buttons PopUpButton[] ---@field attachment? { src: string } ---@field vertical? boolean ---@field inputs? PopUpInput[] ---@field textareas? PopUpTextArea[] ---@field close? fun() ---@class PopUpButton ---@field title string ---@field cb? fun() | number ---@field disabled? boolean ---@field bold? boolean ---@field color? "red" | "blue" ---@class PopUpInput ---@field minCharacters? number ---@field maxCharacters? number ---@field onChange? fun(value: string) | number ---@class PopUpTextArea ---@field minCharacters? number ---@field maxCharacters? number ---@field onChange? fun(value: string) | number
---@param data PopUpData ---@return boolean exports["lb-tablet"]:SetPopUp(data)

SetContextMenu

Types

---@class ContextMenu ---@field id number ---@field title? string ---@field buttons ContextMenuButton[] ---@field close? fun() ---@class ContextMenuButton ---@field title string ---@field cb? fun() | number ---@field color? "red" | "blue" ---@field disabled? boolean
---@param data ContextMenu exports["lb-tablet"]:SetContextMenu(data)

Types

---@class GalleryData ---@field id number ---@field includeVideos? boolean ---@field includeImages? boolean ---@field allowExternal? boolean ---@field multiSelect? boolean ---@field onSelect fun(data: PhotoData | PhotoData[]) | number ---@field close? fun() ---@class PhotoData ---@field id number ---@field src string ---@field timestamp? number ---@field type? "string" ---@field favourite? boolean ---@field isVideo? boolean ---@field size? number ---@field duration? number
---@param data GalleryData exports["lb-tablet"]:Gallery(data)

ColorPicker

Types

---@class ColorPickerData ---@field id number ---@field defaultColor? string ---@field onSelect fun(color: string) | number ---@field onClose? fun(color: string) | number ---@field close? fun()
---@param data ColorPickerData exports["lb-tablet"]:ColorPicker(data)

Camera

EnableWalkableCam

---@param selfieMode? boolean exports["lb-tablet"]:EnableWalkableCam(selfieMode?)

DisableWalkableCam

exports["lb-tablet"]:DisableWalkableCam()

ToggleSelfieCam

---@param selfieMode boolean exports["lb-tablet"]:ToggleSelfieCam(selfieMode)

ToggleCameraFrozen

exports["lb-tablet"]:ToggleCameraFrozen()

IsWalkingCamEnabled

---@return boolean exports["lb-tablet"]:IsWalkingCamEnabled()

IsSelfieCam

---@return boolean exports["lb-tablet"]:IsSelfieCam()

Apps

SetAppHidden

---@param app string ---@param hidden boolean exports["lb-tablet"]:SetAppHidden(app, hidden)

SetAppInstalled

---@param app string ---@param installed boolean exports["lb-tablet"]:SetAppInstalled(app, installed)

Custom apps

AddCustomApp

Types

---@class NewCustomAppData : CustomApp ---@field identifier string ---@field resource string ---@field name string ---@field description? string ---@field icon? string ---@field price? number ---@field images? table ---@field developer? string ---@field size? number ---@field ui? string ---@field defaultApp? boolean ---@field onInstall? function ---@field onOpen? function ---@field onClose? function ---@field onUninstall? function ---@class CustomApp ---@field identifier string ---@field resource string ---@field name string ---@field description? string ---@field icon? string ---@field price? number ---@field images? table ---@field developer? string ---@field size number ---@field ui? string ---@field removable boolean
---@param appData NewCustomAppData ---@return boolean success ---@return "APP_ALREADY_EXISTS" | nil reason exports["lb-tablet"]:AddCustomApp(appData)

RemoveCustomApp

---@param identifier string ---@return boolean ---@return "INVALID_APP" | "WRONG_RESOURCE" | nil reason exports["lb-tablet"]:RemoveCustomApp(identifier)

SendCustomAppMessage

---@param appIdentifier string ---@param event string ---@param data any ---@return boolean ---@return "INVALID_APP" | nil reason exports["lb-tablet"]:SendCustomAppMessage(appIdentifier, event, data)

Dispatch

ToggleDispatchVisible

---@param visible boolean exports["lb-tablet"]:ToggleDispatchVisible(visible)

IsDispatchVisible

---@return boolean exports["lb-tablet"]:IsDispatchVisible()

AddDispatch

Types

---@class NewDispatchOptions ---@field priority 'high' | 'medium' | 'low' ---@field code string ---@field title string ---@field description string ---@field location { label: string, coords: { x: number, y: number } | vector2 } ---@field time number ---@field notificationTime? number ---@field image? string ---@field job? string | string[] ---@field mdt? string ---@field mdts? string[] ---@field sound? string ---@field fields? { icon: string, label: string, value?: string }[] ---@field blip? DispatchBlip ---@field responders? string[] ---@class DispatchBlip ---@field type? "default" | "radius" ---@field handle? number ---@field sprite? number ---@field color? number ---@field size? number ---@field shortRange? boolean ---@field label? string ---@field radius? number ---@field randomCoords? boolean
---@param options NewDispatchOptions exports["lb-tablet"]:AddDispatch(options)

ViewDispatchInTablet

---@param dispatchId number exports["lb-tablet"]:ViewDispatchInTablet(dispatchId)

IsDispatchOnScreen

---@return boolean exports["lb-tablet"]:IsDispatchOnScreen()