Laboratory Creator
Exports & events
Exports, events and commands of nv_laboratorycreator for other resources (police MDTs, admin menus, inventories).
Preview: the script is not released yet. Names can still change; this page is updated with every release.
Server exports
GetHeat
Police heat of every lab, for an MDT or intel app.
local labs = exports.nv_laboratorycreator:GetHeat()
-- { { id = 3, label = 'Sandy Shores Barn', heat = 6, need = 8, sealedLeft = 0 }, ... }
| Field | Meaning |
|---|---|
heat | current heat 0–10 |
need | heat needed before the police can seal the lab |
sealedLeft | seconds until a police seal expires, 0 when not sealed |
AdminLabs
Every lab with owner and balance, for admin menus.
local labs = exports.nv_laboratorycreator:AdminLabs()
-- { { id, label, heat, need, balance, owner, sealed, x, y, z }, ... } sorted by label
AdminSetHeat
exports.nv_laboratorycreator:AdminSetHeat(labId, 0) -- 0–10, returns true / false
AdminAddBalance
Adds (or with a negative amount removes) money from a lab treasury. Returns false when the balance would go below zero.
exports.nv_laboratorycreator:AdminAddBalance(labId, 5000)
AdminRequest
Posts a supply request for a lab without reserving money from its treasury.
exports.nv_laboratorycreator:AdminRequest(labId, 'meth_crystal', 20, 450) -- item, quantity, price per piece
Client exports
useDrug
Plays the use animation and the drug effect. Usable drugs call it automatically; use it when your inventory needs a client export for item use.
exports.nv_laboratorycreator:useDrug({ name = 'meth_crystal' })
Events
| Event | Side | Use |
|---|---|---|
nv_labs:use | client | TriggerClientEvent('nv_labs:use', src, 'meth_crystal') plays a drug effect |
Commands
| Command | Who | What it does |
|---|---|---|
/labs | admin group | lab admin panel; /labs edit opens the editor of the lab you stand in |
/labreset <entrance> | admin group | takes a lab back to the state |
/nvfx, /nvprop | admin group | particle and prop tuning tools |
Optional
bob74_ipl loads the lab interiors. Without it the script runs, prints a warning and some interiors may not load.