carAlarm
Module: vehicle_alarm.lua
What it does
Triggers a car alarm on a randomly selected vehicle within a configurable radius of the player. The alarm plays the VehicleAlarmStandard sound at full volume and emits a large in-game sound event (radius 1000) that attracts zombies. Optionally, an RGB disco-light effect can be enabled — a cycling rainbow light source pulses at the vehicle's position for 48 in-game minutes (2880 ticks) before stopping.
Trigger type
carAlarm
Parameters
| Parameter | Type | Default | Valid Values | Description |
|---|---|---|---|---|
radius |
number | 20 |
Any positive number | Tile radius around the player to search for vehicles. A vehicle is eligible if it is within this many tiles on both the X and Y axes. |
rgb |
string | "off" |
"on", "off" |
When set to "on", a cycling rainbow light effect runs at the vehicle's location for the duration of the alarm. |
If no vehicles are found within the search radius, the player says "No cars nearby to set off." and nothing else happens.
Examples
Trigger a car alarm within 20 tiles (default radius)
{ type="carAlarm" }
Trigger a car alarm within 50 tiles with RGB lights
{ type="carAlarm", radius=50, rgb="on" }
Narrow search, no lights — stealthy chaos
{ type="carAlarm", radius=10, rgb="off" }