tw.witness
Side: Server + Client
Witness alert system that broadcasts notifications and temporary map blips to players with specific jobs (e.g., law enforcement).
Functions
tw.witness.report(jobs, title, message, coords, blipDuration?)
Server-side only. Sends a witness alert to all online players whose job matches one in the list.
| Parameter | Type | Default | Description |
|---|---|---|---|
jobs | table | — | Array of job names to notify (e.g., {"police", "sheriff"}) |
title | string | — | Alert title |
message | string | — | Alert description |
coords | vector3 | — | World coordinates for the blip |
blipDuration | integer? | 600000 (10 min) | Duration in ms before the blip is removed |
Client behavior
The client side is handled automatically. When a report is received:
- A notification is displayed to the player.
- A temporary blip is created at the given coordinates.
- The blip is automatically removed after
blipDurationmilliseconds.
You do not need to write any client-side code for tw.witness.
Examples
Report a crime from server.lua
lua
-- Alert all police and sheriffs about a robbery
tw.witness.report(
{"police", "sheriff"},
"Robbery Reported",
"A witness saw someone robbing the Valentine store",
vec3(-301.62, 783.04, 117.75)
)Custom blip duration (2 minutes)
lua
tw.witness.report(
{"police"},
"Suspicious Activity",
"A citizen reported suspicious activity near the saloon",
vec3(2696.72, -1450.12, 45.26),
120000
)Notes
- Only players whose current job matches one of the
jobsentries will receive the alert. - The blip is automatically cleaned up after the duration expires — no manual removal needed.
- Default blip duration is 10 minutes (600,000 ms).

