Client Exports
OpenComputer
Open a computer from another resource: a laptop item, a phone app, a scripted scene. The server still checks reach and the computer's job lock, so this grants nothing a player could not do at the desk.
Syntax
local opened = exports['sd-computers']:OpenComputer(id, coords, opts)| Parameter | Type | Description |
|---|---|---|
id | string | Any computer's id: from configs/shared/computers.lua, placed in the admin panel (placed_<n>), or added with AddComputer |
coords | vector3? | For a model computer: the prop's position. Left out, the player's own position is used (a laptop held in the hand). Every other computer opens at its own spot |
opts | table? | { style = 'modern' | 'retro' | 'mac' } forces a look for this open |
Returns true when the computer was found (the server can still refuse it: too far, no access), false for an unknown id or one an admin removed in the panel.
The camera goes up to the prop's screen as it does from the target option. With no prop to go to, the desktop opens fullscreen. The server has the same export, to open a computer for a player from there: OpenComputer.
Example
-- A laptop item: open the business laptop computer where the player stands, in the retro look
exports['sd-computers']:OpenComputer('business_laptop', nil, { style = 'retro' })
-- A location computer opens at its own desk
exports['sd-computers']:OpenComputer('mrpd_frontdesk')CloseComputer
Close the computer this player has open: they were cuffed, a cutscene starts. They are signed out and logged off as if they shut it down. To close someone else's, or everyone's at one computer, use the server's CloseComputer.
Syntax
local closed = exports['sd-computers']:CloseComputer()Returns true when a computer was open, false when none was.
IsComputerOpen
Syntax
local open = exports['sd-computers']:IsComputerOpen()Returns true while this player has a computer open. GetCurrentComputer says which one.
StartHack
Run one of the hacking minigames as a standalone hack.exe window, with no computer needed: a heist's door panel, a vault terminal. The run goes through the same server-verified pipeline as Command Prompt, and a win returns a proof that your server code redeems with ConsumeHackProof.
Syntax
local won, proof = exports['sd-computers']:StartHack(opts)
local won, proof = exports['sd-computers']:StartHack(game, difficulty)| Parameter | Type | Description |
|---|---|---|
opts.game / game | string | A minigame key: maze, capture, cipher, snake, firewall, evasion, typing, signal, pipe, breakout |
opts.difficulty / difficulty | string? | 'easy', 'medium' or 'hard'. Default DefaultDifficulty ('medium') |
opts.title | string? | The window's title |
Yields until the player wins, loses or closes the window. Returns won (boolean) and, on a win, proof (string). Only one run at a time: a second call while one is open returns false.

Example
-- client
local won, proof = exports['sd-computers']:StartHack({ game = 'pipe', difficulty = 'medium', title = 'Vault Door' })
if won then
TriggerServerEvent('my-heist:server:openVault', proof)
end
-- server
RegisterNetEvent('my-heist:server:openVault', function(proof)
local src = source
local info = exports['sd-computers']:ConsumeHackProof(src, proof, { game = 'pipe', difficulty = 'medium' })
if not info then return end -- no proof, someone else's, used, expired, or an easier run
-- open the vault
end)Never trust won on its own
won comes from the client. Always redeem the proof on the server before you give anything, or use RunHack, which does it for you.
A run from StartHack is not tied to a place: it proves the player won, not where they were. Check that on the server too. For swapping it into an existing robbery, and the other ways to use the minigames, see Hacks in Your Scripts.
Custom Apps
SendCustomAppMessage, IsAppOpen and GetCurrentComputer, and the sd-computers:appOpened / sd-computers:appClosed events: see Custom Apps.
