Skip to content

Zombies API

bs_zombies is big, but what other resources need is a short list. Everything is on the bs_zombies API page with file and line.

Client:

if exports.bs_zombies:IsWalkerPed(ped) then
local id = exports.bs_zombies:WalkerIdOf(ped) -- registry id, nil if not a walker
end
local crawler = exports.bs_zombies:IsCrawlerPed(ped)

IsWalkerPed/WalkerIdOf also answer from the bsZombie statebag for a networked ped this client hasn’t adopted yet. Use them, don’t check models, the model can be the vanilla one.

Other client helpers: Live() (adopted walkers table), Count(), HostedCount(), HasWalker(id), IsBeingAttacked(), HordeActive(), PlayerProtectedInVehicle().

The server registry owns health. Client damage is reported by the shooter, but for something you own on the server (a turret, a trap) go through:

-- server
exports.bs_zombies:GadgetHit(src, walkerId, damage, x, y, range, weapon)

It checks the walker is within range of x, y. bs_gadgets’ turret uses it, check bs_gadgets/server for the flow (client finds target, server checks fire rate and ammo, then GadgetHit).

Pull walkers to a point:

-- server
exports.bs_zombies:EventNoise(x, y, z, loud)

The decoy gadget calls it every pulse.

For scripted things (bs_events horde waves use these):

-- server
exports.bs_zombies:EventSpawn(x, y, 'walker', { tag = 'myres:wave1', hpScale = 1.0 })
exports.bs_zombies:EventDrive('myres:wave1', x, y, z, seconds) -- push tagged walkers towards a point
local n = exports.bs_zombies:EventCount('myres:wave1')
exports.bs_zombies:EventClear('myres:wave1', keepAsNormal)

Tagged walkers skip the far-cull while tagged. They still count against the pool caps, you can’t spawn past Streaming.PoolGuard.maxNetworked. And the spawn floor (100 m from every player) still applies.

-- server
exports.bs_zombies:SafeZones() -- zone list
exports.bs_zombies:SafeZonesPadded()
exports.bs_zombies:Total() -- registry count
exports.bs_zombies:Heat(zoneId)
exports.bs_zombies:Snapshot()
BagOn
bsZombiepedregistry id. If it’s there, it’s ours
zType, zGait, zCrawl, zFeed, zReach, zState, zMhp, zGround, zApppednetworked mode state
bsZombieDeadpednetworked corpse

Never delete a networked walker yourself. The server tracks unexpected deletes, re-creates the walker if a player is near, and flags the owner in bs_guard (zombie_entity_deleted). If you need them gone, use the event tag + EventClear, or ask the registry.

bs_world’s population sweep already skips anything with bsZombie. If your resource also cleans peds, check IsWalkerPed first.

GlobalState.bsZombieMode is 'networked' or 'legacy'. Most exports work the same in both.