Skip to the content
Docs

Client Exports

On this page5
lua
exports['5code-recognition']:<Name>(...)

Client exports answer from what the player's own game already knows. They never ask the server anything, and they never reveal more than the player's own character knows.

Occasional calls — a command, a menu, one chat line — are fine.

Reading

ExportSignatureReturns
IsScanning()boolean
IsRecognized(targetServerId, minPct?)boolean
GetRecognitionLabel(targetServerId, minPct?)string | nil
GetRecognition(targetServerId)nil | RecognitionInfo
IsFaceHidden()boolean — your own face
IsHudVisible()boolean

minPct defaults to Config.Scoring.ActThreshold (80). RecognitionInfo is described on Server Exports; on the client the label already contains the street names the player's game knows.

lua
if exports['5code-recognition']:IsRecognized(sid) then
    print(exports['5code-recognition']:GetRecognitionLabel(sid))
end

The HUD

ExportSignatureDoes
SetHudVisible(visible, reason?)Hide or show our HUD
SetHudPosition(x, y)Move it (0–1 of the screen, saved on the player's machine)
OpenHudSettings()Open the HUD settings

SetHudVisible keeps a list of reasons: the HUD comes back only when every reason that hid it has shown it again. Pass your own resource name as the reason so two scripts hiding the HUD do not fight:

lua
-- opening your phone
exports['5code-recognition']:SetHudVisible(false, 'my_phone')
-- closing it
exports['5code-recognition']:SetHudVisible(true, 'my_phone')

The default reason is 'external'.

Actions

ExportSignatureDoes
OpenMirrorCheck()Open the mirror card
StartScan(targetServerId)Start a scan — the server checks it exactly as it would a key press
Introduce(targetServerId?)Open the introduce input; defaults to the person in front of you

These are for menus and target scripts. StartScan grants nothing: distance, facing, line of sight, limits and cooldowns are all checked on the server.

Reporting to us

ExportSignatureDoes
ReportLabMatch(data{evidenceType, identifier, source})Report a lab match from a client-side evidence script
ReportDeathSignal(kind, data?)Report a death signal — kind is 'down', 'revived' or 'respawned'

See also