Skip to content

World Events

An add-on for Emergency Response Simulator that spawns random events around the player, from a weighted list you control.

World Events is an ERS add-on. At a set interval it picks an event from your event list and spawns it around the player. You decide which events exist, how likely each one is, how far from the player it can spawn, which services it is for and where on the map it is more or less likely.

The config comes with three events. You can add more.

Event Description Weight Services
Aggravated Person Someone in the area seems to be very angry and aggressive against other people around them. 80 Police
Car Accident A traffic accident has occurred in your vicinity. 60 Police, ambulance, fire, tow
Lost Tourist A tourist who is lost and confused, they are asking for directions to a nearby landmark. 40 Police, ambulance, fire, tow
  1. Put the night_ers_worldevents folder in your server’s resources folder.
  2. Add this line to server.cfg, below ensure night_ers:
ensure night_ers_worldevents
  1. Restart your server.

All settings are in config/config.lua. The manifest leaves config/*.lua outside the asset escrow, so you can edit it.

EventInterval = {120, 240}, -- Time in seconds between events.
DistanceToStopEvent = 200.0, -- Distance to stop the event when the player is too far away.
Setting What it does
EventInterval The time between events, in seconds, as a minimum and a maximum
DistanceToStopEvent The distance at which an event stops because the player is too far away

Every entry in Events is one event:

{
Name = "Aggravated Person", -- Name of the event.
Description = "Someone in the area seems to be very angry and aggressive against other people around them.", -- Description of the event.
Weight = 80, -- Weight of the event, higher weight means it's more likely to spawn.
ZoneMultiplier = {["AIRP"] = 0.8, ["DAVIS"] = 1.2, ["BEACH"] = 0.9, ["DOWNT"] = 1.5}, -- Above 1.0 is higher chance to spawn in the area you are in, below 1.0 is lower chance to spawn.
SpawnOffset = {min = -50.0, max = 50.0}, -- Spawn offset for the event, this is the range that the event can spawn in around the player.
ServiceTypes = { "police" }, -- Service types for which the event is available. (Options: police, ambulance, fire, tow)
},
Setting What it does
Name The name of the event
Description The description of the event
Weight How likely the event is to spawn. A higher weight is more likely
ZoneMultiplier A multiplier per map zone. Above 1.0 is a higher chance to spawn in the area you are in, below 1.0 is a lower chance
SpawnOffset The range, as a minimum and a maximum, in which the event can spawn around the player
ServiceTypes The services the event is available for. Options: police, ambulance, fire and tow

The config points to the FiveM natives reference for finding zones.

An event’s chance is its weight divided by the total weight of all events. With the three events above the total is 80 + 60 + 40 = 180:

Event Calculation Chance
Aggravated Person 80 / 180 44.4%
Car Accident 60 / 180 33.3%
Lost Tourist 40 / 180 22.2%

Read through the instructions again if you have not managed to install the resource. Can’t get it to work still? Create a ticket through our dedicated support system in Discord:

Nights Software Discord