pen-to-squareEditable

These files are not encrypted and can be freely modified. They are located in the client/editable/ and server/editable/ folders.

Client Side

client/editable/events.lua

onZombieSpawned(entity, type, networkId)

Called when a zombie is fully spawned and initialized. Use this to add custom logic like attaching props, setting blip colors by type, or triggering events.

  • entity - the ped handle

  • type - zombie type name from Config.types (e.g., "default", "screamer", "trainer")

  • networkId - the network ID of the ped

function onZombieSpawned(entity, type, networkId)
    -- Example: print spawn info
    print("Spawned " .. type .. " zombie with net ID " .. networkId)
end

isDead(source)

Returns whether a player is dead. Used internally to skip dead players during spawn checks. Override this if your death system uses a different state.

function isDead(source)
    return Player(source).state.isDead
end

No-Spawn Zone System

Coordinate-based spawn prevention. Unlike safe zones (which block spawns based on player enter/exit), no-spawn zones prevent zombies from spawning at specific coordinates regardless of player location.

Other scripts can register and unregister zones via exports:

canSpawnZombieAtCoords(coords)

Called before spawning a zombie at the given coordinates. Return true to allow, false to deny. Each denial increases the spawn radius by Config.distances.spawnRadiusIncrement (default 5m).

You can add custom logic here beyond the no-spawn zone system:


client/editable/zones.lua

Zone entry/exit callbacks. Use any notification system you want (ox_lib, esx, qb, okokNotify, etc.). The zone object is passed as a parameter so you can access its properties (coords, radius, blip settings, etc.).


client/editable/target.lua

createTarget(obj, lootId)

Sets up the loot interaction on a dropped loot object. Supports ox_target and qb-target based on Config.targetResource. Override this if you use a different target system.


client/editable/jacking.lua

Controls whether zombies can pull players out of vehicles. When Config.enableJacking is false, this file prevents the player from being dragged out.

Set Config.enableJacking = true in your config to allow zombies to pull players from vehicles.


Server Side

server/editable/handlers.lua

onKillPed(source, pedData)

Called when a player kills a zombie. Use this for custom rewards like XP, money, kill counters, or achievements.

  • source - player server ID who killed the zombie

  • pedData - the zombie's type data from Config.types (includes health, speed, lootTable, abilities, etc.)


server/editable/inventory.lua

addItem(source, itemName, count)

Called when loot is added to a player's inventory. Override this if you use an inventory system that is not supported by 5s_lib.

Custom inventory example:

playerTryTriggerSecuredEvent(src)

Called when a player sends an invalid secured network event (anti-cheat). Default action is to kick the player.

Last updated