indoorAlarm
Module: indoorAlarm — environment_alarm.lua
What it does
Scans a configurable radius around the local player for indoor tiles. If any are found, one is chosen at random and a HouseAlarm sound is played from that location. An addSound meta-event is also broadcast so nearby zombies can hear it. The player says a chat line confirming the alarm. Optionally, an RGB cycling light source is created at the alarm's position and cycles through the full colour spectrum for 48 in-game hours (or until the alarm stops), creating a disco-like effect.
Trigger type
indoorAlarm
Parameters
| Parameter | Type | Default | Valid Values | Description |
|---|---|---|---|---|
type |
string | required | "indoorAlarm" |
Must exactly match the module name. |
radius |
number | 20 |
Any positive integer | Tile radius around the player to search for indoor squares where the alarm can be placed. |
rgb |
string | "off" |
"on", "off" |
When set to "on", a colour-cycling RGB light source is added at the alarm position for the duration of the alarm. |
Examples
Minimal: plain alarm with default 20-tile search radius
{ type="indoorAlarm" }
Alarm with RGB lights, wider search area
{ type="indoorAlarm", radius=40, rgb="on" }
Tight radius, no lights
{ type="indoorAlarm", radius=10, rgb="off" }