Kartik Scripts

Server Exports

Use these server-side exports to integrate Kartik Evidence with your world events and background scripts.

AddEvidenceToCoords

exports['kartik-evidence']:AddEvidenceToCoords(coords, evidenceType, metadata)

๐Ÿ”น Description

Spawns a specific piece of evidence at a location in the world.

๐Ÿ”ง Parameters

NameTypeDescription
coordsvector3The world coordinates.
evidenceTypestringThe type (e.g. blood, casing).
metadatatableMetadata like dna, fingerprint, or caliber.

AddEvidenceToPlayer

exports['kartik-evidence']:AddEvidenceToPlayer(targetSource, evidenceType, metadata)

๐Ÿ”น Description

Attaches evidence directly to a player (e.g. gunpowder residue or footprints).


AddEvidenceToEntity

exports['kartik-evidence']:AddEvidenceToEntity(entity, evidenceType, metadata)

๐Ÿ”น Description

Attaches evidence to a vehicle or prop, allowing it to move with the entity.


RegisterProcessingHandler

exports['kartik-evidence']:RegisterProcessingHandler(itemName, machineType, callback)

๐Ÿ”น Description

Defines the server-side logic that occurs after an item is processed in a forensic machine.

๐Ÿ”ง Parameters

NameTypeDescription
itemNamestringThe item being processed.
machineTypestringCentrifuge, DnaScanner, etc.
callbackfunctionThe logic to execute (params: source, slot, itemData).

GiveItem / RemoveItem

exports['kartik-evidence']:GiveItem(source, item, count, metadata)
exports['kartik-evidence']:RemoveItem(source, item, count, metadata, slot)

๐Ÿ”น Description

Framework-agnostic helpers for item management. These automatically interface with the active inventory bridge (Ox, QB, etc.).


GetPlayerBiometrics

local data = exports['kartik-evidence']:GetPlayerBiometrics(citizenId)

๐Ÿ”น Description

Retrieves the stored DNA and Fingerprint identifiers for a specific Citizen ID.

๐Ÿ”ง Parameters

NameTypeDescription
citizenIdstringThe unique citizen identifier to look up.

๐Ÿ“ฆ Returns

Returns a table containing dna, fingerprint, isDnaTaken, and isFingerprintTaken, or nil if not found.


GetCaseFullDetails

local caseDetails = exports['kartik-evidence']:GetCaseFullDetails(caseId)

๐Ÿ”น Description

Fetches the complete details of a crime scene case, including metadata, linked physical items from the stash, and linked biometric references.

๐Ÿ”ง Parameters

NameTypeDescription
caseIdnumber | stringThe ID of the forensic case.

๐Ÿ“ฆ Returns

Returns a table containing case details (or nil if not found):

  • id (number): Case ID.
  • title (string): Title of the case.
  • officer (string): Investigator's name.
  • officerCid (string): Investigator's Citizen ID.
  • location (string): Location of the crime scene.
  • narrative (string): Case description/notes.
  • status (string): Current case status (e.g., 'active').
  • images (table): Array of linked images.
  • items (table): Array of linked physical items in the case locker.
  • biometrics (table): Array of linked biometrics.
  • created_at (string): Timestamp of creation.

GetBiometricData

local biometricVal = exports['kartik-evidence']:GetBiometricData(source, type)

๐Ÿ”น Description

Retrieves the DNA or fingerprint identifier for a specific player source. If the player's evidence has not been loaded yet, it will load/generate it from the database first.

๐Ÿ”ง Parameters

NameTypeDescription
sourcenumberThe player's server ID.
typestringThe biometric type ("fingerprint" or "dna").

๐Ÿ“ฆ Returns

Returns a string representing the biometric code, or nil if not found or invalid.


ClearGSR

exports['kartik-evidence']:ClearGSR(source)

๐Ÿ”น Description

Clears Gunshot Residue (GSR) for a specific player.

๐Ÿ”ง Parameters

NameTypeDescription
sourcenumberThe player's server ID.

SetResidueStatus

exports['kartik-evidence']:SetResidueStatus(source, state)

๐Ÿ”น Description

Sets the Gunshot Residue (GSR) state for a specific player.

๐Ÿ”ง Parameters

NameTypeDescription
sourcenumberThe player's server ID.
statebooleantrue to apply GSR, false to clear it.

On this page