> For the complete documentation index, see [llms.txt](https://5scripts-1.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://5scripts-1.gitbook.io/docs/assets/5s_zombies/faq.md).

# FAQ

<details>

<summary>What game build do I need?</summary>

The script works on **most FiveM servers**. We recommend **build b3570+** for the easiest setup, but we include a free compatibility pack for older builds.

| Build          | What to expect                                                                                                                                                                                                                                                                                |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **3570+**      | Everything works out of the box - no compatibility pack needed.                                                                                                                                                                                                                               |
| **3258, 3407** | All features work, including zombie combat animations. Just start `5s_zombies_compat`.                                                                                                                                                                                                        |
| **2944, 3095** | The script works with the compatibility pack. Zombie combat animations are not available on these builds because they need game files added in build 3258. Zombies will still fight, but they will use default GTA V melee animations like any other ped instead of custom zombie animations. |
| **Below 2944** | Not tested. The script may work, but we can't fully guarantee it.                                                                                                                                                                                                                             |

See the [Install](/docs/assets/5s_zombies/install.md) page for setup steps.

</details>

<details>

<summary>How do I set the game build?</summary>

You set the game build in your `server.cfg` with `sv_enforceGameBuild`. This can only be set at startup, it cannot be changed while the server is running.

```cfg
sv_enforceGameBuild 3570
```

Replace `3570` with the build you want. We recommend **3570 or newer** so everything works without the compatibility pack.

If you don't add this line, your server uses the default build. For the full list of build numbers see the [FiveM server commands docs](https://docs.fivem.net/docs/server-manual/server-commands/).

</details>

<details>

<summary>What is the compatibility pack (5s_zombies_compat)?</summary>

A free resource included with your purchase. It adds zombie models, animations and props for servers on builds older than b3570. Just add `ensure 5s_zombies_compat` to your `server.cfg` and you're done.

What's inside:

* **Zombie ped models** - `G_M_M_Zombie_01`, `G_M_M_Zombie_02`, `G_M_M_Zombie_04`, `G_M_M_Zombie_05`, `G_F_M_UndeadMage`, `IG_Gustavo_02`, `IG_Skeleton_01`, `IG_Zombie_DJ_01` (with textures and `_p` pristine variants)
* **Animations** - zombie combat (core, taunts, variations), movement (core, strafe), spawn sequences (runner, shambler), summoner ritual (female, male)
* **Ped metadata** - `peds.meta` with all zombie ped definitions
* **Clip sets** - `clip_sets.xml` for zombie movement
* **Props and objects** - zombie staff and 50+ props used by special zombie types
* **Expressions** - facial expressions for zombie peds
* **Scenarios** - behavior trees and scenario definitions
* **Audio** - sound banks and audio config

If you are on build 3570+, you don't need this resource.

</details>

<details>

<summary>Which target systems are supported?</summary>

`ox_target` and `qb-target`. The target system is set once in `5s_lib` (it's shared by all 5s scripts), not in the zombies config. Open `5s_lib/config.lua` and set:

```lua
Config.target = "ox_target" -- or "qb-target"
```

This only matters in `"interact"` loot mode, where you search zombie corpses. In `"instant"` mode loot drops straight into the inventory and no target system is used.

</details>

<details>

<summary>How do I add custom zombie types?</summary>

1. Add a new entry in `Config.types` with a unique name. Only include fields you want to change - omitted fields use `Config.typeDefaults`.
2. To make it spawn naturally, add its name to the `spawnChances` table in any zone archetype (`Config.zoneArchetypes`).
3. You can also add it to danger zone `pedsToSpawn` for guaranteed spawns in specific areas.

```lua
Config.types["myCustomZombie"] = {
    model = { "your_ped_model" },
    health = 300,
    armor = 100,
    speed = 1.5,
    lootTable = "default",
    reactToPlayerDistance = 20.0,
}

-- Add it to zone archetypes where you want it to spawn naturally:
Config.zoneArchetypes.urban.spawnChances["myCustomZombie"] = 10
Config.zoneArchetypes.downtown.spawnChances["myCustomZombie"] = 5

```

See the [Config](/docs/assets/5s_zombies/config.md) page for all available type fields and the [Zombie Types](https://gitlab.d2qube.com/5scripts/5s_docs/-/tree/main/assets/5s_zombies/zombie-types.md) page for built-in types.

</details>

<details>

<summary>How do I configure loot drops?</summary>

Loot tables are in `Config.lootTables`. There are two kinds of tables:

* **Zone-based tables** (`default`, `military`, `industrial`, `downtown`, `rural`) - assigned to zone archetypes via `Config.zoneArchetypes`. Zombies with `lootTable = "default"` use whichever table their zone archetype specifies.
* **Type-specific tables** (`tank`, `juggernaut`, `skeleton`) - assigned directly to a zombie type. These always drop the same loot regardless of where the zombie died.

Each table has a `chance` (% chance the zombie drops anything), `maxItems` (cap on items per drop), and an `items` list where each item has its own drop `chance` weight and quantity range.

```lua
Config.lootTables["rare"] = {
    maxItems = 3,
    chance = 40,
    items = {
        { item = "medkit",     min = 1, max = 1, chance = 30 },
        { item = "ammo-rifle", min = 5, max = 15, chance = 40 },
        { item = "hqm",        min = 1, max = 2, chance = 30 },
    }
}
```

Then set `lootTable = "rare"` on the zombie type you want, or assign it to a zone archetype with `lootTable = "rare"`.

Item names must match your inventory system exactly.

</details>

<details>

<summary>Can I spawn zombies from other scripts?</summary>

Yes. Use the `spawnZombies` export:

```lua
exports['5s_zombies']:spawnZombies('default', vector3(100.0, 200.0, 30.0), 5)
```

See the [Exports](/docs/assets/5s_zombies/exports.md) page for all exports.

</details>

<details>

<summary>How do safe zones and danger zones work?</summary>

* **Safe zones** - zombies don't spawn inside them. Set them up in `Config.zones.safeZones`. You can also show blips on the map.
* **Danger zones** - areas with special zombie types and their own respawn timers. Set them up in `Config.zones.dangerZones`.

You can check if a player is in a zone from other scripts using the `isInGreenZone()` and `isInDangerZone()` exports.

To control where zombies spawn across the map (and how to limit them to one area), see the [Spawn Areas](/docs/assets/5s_zombies/spawn-areas.md) page.

</details>

<details>

<summary>Should I make one giant danger zone to cover a whole area?</summary>

No. A danger zone spawns a **fixed** number of zombies (the total of its `pedsToSpawn`), no matter how big it is, and they cluster around the players in the zone instead of spreading out. Blow one zone up to cover a region and you get a few zombies bunched near players, the rest empty. Zone zombies also wander the full radius and don't despawn with distance, so coverage drifts and gets patchy.

For even coverage across an area, use the grid system instead, see [Spawn Areas](/docs/assets/5s_zombies/spawn-areas.md). Grids spawn around each player wherever they cover, and scale with how many players are nearby. Keep danger zones small and focused: a POI, a boss arena, a spot you want to feel hot.

</details>

<details>

<summary>How does zombie spawning and networking work?</summary>

Zombies are client-side entities with server-side coordination.

* The **server** decides when to spawn zombies, how many, and what type based on the zone, nearby players, and other conditions. It also handles loot drops on death, despawning distant zombies, cleaning up bodies, and safe zone enforcement.
* The **client** creates the zombie ped and runs its AI (chasing, attacking, wandering).
* Zombies are **fully networked** - every player in the area sees the same zombies in the same positions. They are not "ghost" entities only visible to one player.

</details>

<details>

<summary>What is the difference between "instant" and "interact" loot mode?</summary>

Set with `Config.lootMode`:

* `"instant"` - loot goes straight into the player's inventory when a zombie dies.
* `"interact"` - the player has to interact with the zombie body to pick up loot (uses your target system).

</details>

<details>

<summary>How do I adjust zombie population and density?</summary>

How many zombies a zone has is set by `maxZombies` on each archetype in `Config.zoneArchetypes`. Raise it for a busier zone, lower it for a quieter one:

```lua
Config.zoneArchetypes.military.maxZombies = 32   -- busier
Config.zoneArchetypes.rural.maxZombies    = 16   -- quieter
```

Two settings in `Config.threadSettings` tune it further:

* `playerScalingFactor` - spawns more zombies as more players gather in the same area.
* `maxZombiesCountInSquare` - hard cap per area. Lower it if you need better performance.

```lua
Config.threadSettings = {
    playerScalingFactor     = 0.3,
    maxZombiesCountInSquare = 50,
}
```

</details>

<details>

<summary>Is 5s_zombies integrated with 5s_building?</summary>

Yes, and it's automatic. When both resources are running:

* **Player bases are protected from spawns.** 5s\_building registers each Tool Cupboard territory as a no-spawn zone, so zombies will not spawn inside bases.
* **Safe zones and danger zones block building.** 5s\_building reads your 5s\_zombies safe zones and danger zones and turns them into no-build zones.

This runs through exports 5s\_zombies provides (`addNoSpawnZone`, `removeNoSpawnZone`, `getSafeZones`, `getDangerZones`), so any other script can use the same no-spawn zone system too.

</details>
