For the complete documentation index, see llms.txt. This page is also available as Markdown.

Natural Disasters

AV Weather can roll natural disasters at random across your map, or let admins trigger them on demand. A disaster takes over a zone with extreme weather (and, for tornadoes, a physical funnel), runs for a while, and then the zone returns to its normal weather cycle on its own.

Everything is configured in config/_disasters.lua. Nothing else is required — disasters reuse the same per-zone system as the rest of the script.

Disasters are server-authoritative. The server decides what happens and where; every player sees the same event in the same place. Only one disaster is ever active at a time.

How it works

Every checkInterval minutes the server rolls once:

  1. It checks globalChance — the chance that any disaster happens on this roll.

  2. If it hits, it picks a zone and a disaster type using the weights in Config.ZoneDisasters. A zone with bigger weights is more likely to be chosen.

  3. The zone's weather is forced (e.g. THUNDER + heavy wind + fog) and normal weather generation for that zone is paused.

  4. Players get a warning, then the event begins.

  5. After a random duration between minDuration and maxDuration, the disaster ends and the zone resumes its normal weather.

  6. A cooldown must pass before a new disaster can be rolled.

Admins can also force any disaster in any zone at any time from the weather menu or via exports — even a disaster whose weight is 0 in that zone.


Global settings — Config.Disasters

These control the automatic random system as a whole.

Field
Type
What it does

enabled

boolean

Turn the automatic (random) system on or off. Manual triggering still works when this is false.

checkInterval

minutes

How often the server rolls the dice.

globalChance

0–100

On each roll, the percent chance that a disaster starts at all.

cooldown

minutes

Quiet period after a disaster ends before the next roll can succeed.

minDuration / maxDuration

minutes

The event lasts a random time between these two values.

warnSeconds

seconds

Advance warning before the event actually begins. 0 = it hits instantly.

globalChance decides if a disaster happens. It does not decide which one or where — that is Config.ZoneDisasters below. Keeping the two separate lets you make disasters rare overall while still controlling their distribution.


Probability per zone — Config.ZoneDisasters

This table decides where a disaster lands and which type, using relative weights per zone. The keys must match your zone keys in config/_zones.lua.

Rules:

  • Weights are relative — they do not need to add up to 100.

  • A weight of 0 means "this disaster never happens here" automatically.

  • A zone not listed in this table never gets an automatic disaster at all.

  • Admins can still force any disaster in any zone from the menu, even one weighted 0.

Worked example

With sandy.tornado = 45 and paleto.tornado = 25, a tornado is roughly 1.8× more likely to form in Sandy Shores than in Paleto Bay (45 ÷ 25). Weights are pooled across every zone and type together, so higher numbers simply mean "more likely to be picked".

Adding a custom zone

If you added a new zone in config/_zones.lua (say vinewood), add a matching entry here so it can receive disasters:


Disaster types — Config.DisasterTypes

Each entry defines what a disaster is. The where/how-often lives in Config.ZoneDisasters; the behaviour and looks live here.

Shared fields

Most disasters share these:

Field
Type
What it does

label

string

Display name used in logs and the menu.

weather

string

GTA weather forced on the zone (THUNDER, RAIN, etc.). Omit for cosmetic events.

wind

number

Wind speed applied to the zone (m/s, 0–12).

fog

string

Fog preset applied to the zone (no, low, medium, high, max).

lightning

boolean

Periodic lightning flashes + thunder.

lightningInterval

{min, max}

Seconds between lightning flashes.

shake

boolean

Camera shake for players inside the zone.

shakeIntensity

number

Strength of the shake (higher = stronger).

The weather, wind and fog are applied through the normal zone system, so they sync to everyone automatically. The lightning and shake are cinematic effects that only play for players who are actually inside the affected zone.


Hurricane

The heaviest storm: max wind, thick fog, frequent lightning and a light, continuous camera buffeting.

Best used sparingly and in coastal zones (Paleto, Cayo).


Thunderstorm

A lighter storm — frequent lightning, moderate wind, low fog, and no shake. Good as a common, everyday severe-weather event.


Earthquake

A cosmetic event: it does not change the weather. Instead it delivers a series of strong camera jolts, and can knock players off their feet.

Field
Type
What it does

cosmetic

boolean

Marks the event as weather-neutral. The zone keeps its normal weather.

shakePulses

{min, max}

How many jolts happen, spread evenly over the event's duration.

fallingProb

0–100

Per jolt, the chance an on-foot player is ragdolled forward. Players in vehicles are never affected.

Because the earthquake is cosmetic, it can safely overlap with whatever weather the zone already has — it never freezes or changes the forecast.


Tornado

The showpiece: a moving funnel that travels across the zone, sucking in nearby players, vehicles and objects. The storm weather is applied to the zone, and the funnel itself is rendered client-side with physics.

Field
Type
What it does

tornado

boolean

Required. Set true to make the funnel spawn. Without it, the entry behaves like a normal storm.

moveSpeed

m/s

How fast the funnel wanders across the zone. It always stays inside the zone polygon.

height

metres

Total funnel height.

baseRadius / topRadius

metres

Funnel width at the ground and at the top (it widens upward into a cone).

rings

count

Vertical rings of particles. Keep ≤ 8 for performance.

perRing

count

Particles per ring. Keep ≤ 6. rings × perRing is the total particle count (30 is a good balance).

spinSpeed

rad/s

How fast the funnel visually rotates.

particleDict / particleName / particleScale

The particle asset and its size.

renderDistance

metres

Players only render the funnel within this distance.

pullRadius

metres

Entities inside this radius are pulled toward the funnel.

pullForce

number

Suction strength.

coreRadius

metres

Inside this inner radius, on-foot players are ragdolled and thrown.

Tune pullForce carefully. Start at 12.0 and raise it in small steps — too high launches vehicles into orbit and feels wrong. Likewise, only raise rings and perRing if your server's FPS can take it.


From other resources (exports)

startDisaster returns ok, errorMessage. It fails (returns false) if a disaster is already active or the zone/type is unknown.


Custom warning hook

When a disaster is scheduled with warnSeconds > 0, the server calls a hook in server/editable/disasters.lua before the event begins. This is where you add your own alert — a notification, a siren sound, a UI banner, anything.

Last updated