Configuration

This section includes all configurable files for the selected script. Most settings are configured automatically, but each config.lua file contains a header comment explaining the purpose and usage of every configuration type. Be sure to read the header of each file carefully to fully understand how to customize and adapt the system for QBCORE, ESX, or standalone environments, ensuring seamless integration with your server.


qs-biohazard/config.lua
Config  = Config or {}
Locales = Locales or {}

--[[  Languages available by default:
      'ar','bg','ca','da','de','en','es','fa','fr','he','hi','it','jp','ko','pt','ru','tr','zh-CN','zh-TW'  ]]
Config.Language                  = 'en' -- Language key (must exist in locales/*.lua), e.g. 'en' for English, 'es' for Spanish.

-- =========================
-- ADMIN / COMMAND
-- =========================
Config.Command                   = 'biohazard' -- Admin command to start/stop the event: /biohazard <seconds|stop>
Config.RequireAce                = true        -- true = only players with ACE permission can use the command (add_ace group.admin "command.biohazard" allow)

-- =========================
-- DEBUG
-- =========================
Config.Debug                     = false -- true = print debug info to console/chat (very helpful while testing)

-- =========================
-- EVENT DURATION
-- =========================
Config.DefaultDuration           = 15 * 60 -- Default duration in seconds if not provided in the command

-- =========================
-- AMBIENCE (active while the event runs)
-- =========================
Config.SetNightHour              = 22          -- Fixed game hour during the event (0–23) if FreezeTime = true
Config.FreezeTime                = true        -- true = freeze the clock at SetNightHour for the whole event
Config.SetBlackout               = true        -- true = city lights off for a darker, spookier vibe
Config.Weather                   = 'FOGGY'     -- Weather to enforce (if ForceWeather = true). e.g., CLEAR/FOGGY/RAIN/THUNDER
Config.ForceWeather              = true        -- true = force the weather specified in Weather above
Config.Timecycle                 = 'Halloween' -- Visual filter (timecycle) name applied while running (non-blinding)
Config.TimecycleStrength         = 1.0         -- Timecycle intensity (0.0 = none, 1.0 = full effect)

-- =========================
-- ZOMBIE MODEL (single)
-- =========================
Config.ZombieModel               = `u_m_y_zombie_01` -- Single zombie model for AI and infected players (change to any supported model)
Config.PlayerZombieModelChange   = true              -- true = when infected, player model switches to Config.ZombieModel (restored when event ends)

Config.ZombieModelProfiles       = {                 -- Per-model profile: animation set(s) + ragdoll duration for the victim on hit
    [`u_m_y_zombie_01`] = {
        sets    = { 'move_m@drunk@verydrunk' },      -- Movement “gait” list (drunk walk) applied to this zombie model
        ragdoll = 1000                               -- Milliseconds the player ragdolls when punched by this model
    },
}
Config.ZombieDefaultAnimSets     = { 'move_m@drunk@verydrunk' } -- Fallback gait set if the model lacks an entry above
Config.PlayerHitRagdollMsDefault = 1000                         -- Default ragdoll duration if the model has no profile
Config.RagdollCooldownMs         = 1200                         -- Minimum time between ragdolls so hits don’t chain-stun

-- =========================
-- AI / MOVEMENT (aggressive)
-- =========================
Config.ZombieSpeed               = 3.0   -- Desired movement speed (≈ sprint). Zombies rush you relentlessly.
Config.ZombieMoveRateOverride    = 10.0  -- Extra speed multiplier (higher = more rabid behavior)
Config.AI_RetaskMs               = 100   -- How often (ms) AI re-evaluates targets/actions
Config.AI_MeleeStartRange        = 5.5   -- Distance at which AI switches to melee (punch) on the target
Config.AI_MaxChaseDist           = 400.0 -- Max distance the zombie will keep chasing a player

-- =========================
-- HORDE SIZE / SPAWN
-- =========================
Config.HordeSizeBase             = 8    -- Base number of zombies even with a single player online
Config.HordePerPlayer            = 3    -- Extra zombies per online player
Config.SpawnRadiusMin            = 25.0 -- Minimum distance from players where zombies can spawn
Config.SpawnRadiusMax            = 60.0 -- Maximum distance from players where zombies can spawn
Config.MaxZombiesGlobal          = 120  -- Hard cap for total zombies (performance safety)
Config.SpawnBurstMax             = 12   -- Max zombies requested per spawn burst to reach the target count quickly

-- =========================
-- INFECTION (human -> zombie via hits)
-- =========================
Config.HitsToInfect              = 3   -- Number of zombie hits required to infect a human
Config.HitCooldownMs             = 400 -- Cooldown window between counted hits (prevents double-counting same tick)
Config.NearZombieRange           = 3.0 -- Range to validate the hit came from a nearby zombie
Config.HPFloorOnHit              = 140 -- Clamp player HP to this floor on each hit (prevents instant deaths)
Config.HPMinSafety               = 125 -- Minimum HP the script tries to keep humans above during the event

-- =========================
-- ZOMBIE PLAYER TIMER (must infect before timeout)
-- =========================
Config.ZombieInfectWindow        = 90   -- Seconds a zombie player has to infect someone else
Config.ZombieDieIfNoInfect       = true -- true = when the timer hits 0, the zombie dies (or drops to 0 HP)

-- =========================
-- GRACE / SERVER REPLY
-- =========================
Config.InfectGraceMs             = 1500 -- Brief invulnerability while transforming (avoid scuffed deaths)
Config.ServerReplyTimeout        = 2000 -- If the server didn’t reply within X ms, the client retries the infection request

-- =========================
-- HUD
-- =========================
Config.DrawTimer                 = true -- true = draw HUD timer for the event and zombie-infect window
Config.DrawTimerScale            = 0.5  -- Text scale for the HUD
Config.DrawTimerY                = 0.90 -- Vertical screen position (0.0 = top, 1.0 = bottom)

-- =========================
-- PERMISSIONS / CLEANUP
-- =========================
Config.DeleteDeadZombies         = true -- true = delete dead zombie peds to keep the map clean
Config.CleanUpOnStop             = true -- true = on stop, force cleanup of all remaining zombies

-- =========================
-- RESTORE ON FINISH
-- =========================
Config.RestoreWeatherTo          = 'EXTRASUNNY' -- Weather to restore when the event ends
Config.RestoreHourTo             = 12           -- Hour (0–23) to restore when the event ends

-- =========================
-- GLOBAL AI DAMAGE SCALE (during event)
-- =========================
Config.ZombieDamageScale         = 0.25 -- AI damage multiplier (1.0 = normal, 0.25 = they do 75% less damage)

-- =========================
-- AUTO START (server should implement the scheduler)
-- =========================
Config.AutoStart                 = {
    Enabled        = true, -- true = event auto-starts every X hours (randomized)
    MinHours       = 2,    -- Minimum hours between auto-starts
    MaxHours       = 5,    -- Maximum hours between auto-starts
    AnnounceInChat = true  -- true = announce in chat when an auto-start triggers
}

-- =========================
-- INTRO / ENDING OVERLAYS (+ sound)
-- =========================
-- 'sound' is optional. If enabled, NUI will play the audio when showing the overlay.
-- volume: 0.0–1.0

Config.IntroImage                = {
    enable   = true,
    url      = 'intro.gif',
    duration = 4000,
    sound    = { enable = true, url = 'sounds/evil_laugh.mp3', volume = 0.2 }
}

Config.EndImage                  = {
    enable   = true,
    url      = 'ending.gif',
    duration = 1800,
    sound    = { enable = true, url = 'sounds/evil_laugh.mp3', volume = 0.2 }
}

-- =========================
-- FX: Infection pulses while still human (soft “drunk” fade in/out)
-- =========================
Config.InfectionDrunk            = {
    Enabled       = true, -- true = apply a soft “drunk” camera when a zombie hits you (before conversion)
    DurationMs    = 6000, -- Base total time the effect lasts; extended on each new hit
    ExtendOnHitMs = 2000, -- Extra time added per hit while the effect is active
    CamShakeAmp   = 0.16  -- Baseline camera shake amplitude (client smooths it with fade in/out)
}

-- =========================
-- FX: Zombie pulse when taking damage (while you are a zombie)
-- =========================
Config.ZombiePulseFX             = {
    Enabled        = true,            -- true = while a zombie, taking damage triggers a gentle pulse effect
    MinPauseMs     = 6000,            -- Minimum pause between automatic pulses (if used)
    MaxPauseMs     = 14000,           -- Maximum pause between automatic pulses
    MinDurMs       = 1200,            -- Minimum pulse duration (ms)
    MaxDurMs       = 2600,            -- Maximum pulse duration (ms)
    CamShakeAmpMin = 0.08,            -- Minimum camera shake amplitude during a pulse
    CamShakeAmpMax = 0.18,            -- Maximum camera shake amplitude during a pulse
    ScreenFX       = 'DrugsDrivingIn' -- Screen effect name (subtle, won’t blind players)
}