Lua's Spawn Rework 2.1.2

Mods made for AKI 2.3.1 or older are NOT compatible with 3.0.0.
Please do not spam mod comments with requests for mods to be updated - repeat offenders will be muted at moderator discretion.

Former CPSR, Bot Spawn Rework System


Original by ClairrePurr/Icesugar and Reborn by Hosav

Do not disable Boss Enable in Game Raid Setting
Disable has_boss in patterns config instead

MOD IS DISABLED by Default, Check config.json

I have been using Hosav's version and quite liked a lot

Trying to fix some bugs and adding more features with configs

pattern JSON files are now inside of config folder

  • Lua-Default.json has customized values which is I have been using
  • Feel free to make your own pattern and share

:!: Cultists are only spawn at night (22:00 ~ 06:00), If you want to spawn at day than use cultists on other bosses escort, or edit script to replace raiders

- OR use the patch mod



Recommend to use with other AI Mod without Spawn changes

(Personally I used Fin's AI Mod for AI change only)

:!: If you use Fin's AI Mod, you need to "disableAllSpawnChanges" sets to true

Quote from Shiro-chan due to the virus reports

Edit made by myself.
Virus Total checked, virus total personally and checked with alternatives, all files came clean.
At the moment, it seems fixed and no longer flags.



Bot Generation Server Logs



  • Version 2.1.2

    • Removed "usec_default_enemy" and "bear_default_enemy" option in pattern config
    • Replaced pmc type option "pmc_type" in pattern config
    • Supported "akiVersion": 3.2.3
  • Version 2.1.1

    • Fixed "gifter" role for temporary until 3.2.1 hotfix releases
    • Fixed customs map "OpenZones" for missing "ZoneScavBase"
    • Lua-Default.json pattern update
      • All "gifter" chance to 5
      • All "random boss" chance to 10 from 5
    • Supported "akiVersion": 3.2.1 / 3.2.2
  • Version 2.1.0

    • Updated for SPT 3.2.0
    • Removed option "cursedAssault_chance" for PMC in pattern json
      • You can use the "cursedAssault" role to "bear/usec_type" in pattern json instead
    • Lua-Default.json pattern update
      • For SPT 3.2.0 only, "gifter" is disabled in default pattern json
        • Do not use it until next SPT 3.2.0 hotfix or update
      • "spawn_scav_raider_location_chance" to 44 from 33
    • Supported "akiVersion": 3.2.0
  • Version 2.0.5

    • Fixed error that trying to load not an map setting in pattern json
    • Supported "akiVersion": 3.1.x
  • Version 2.0.4

    • Fixed Escort amount missing error when random escorts generates
    • I forget to mention before
      • Map names in the pattern json are now all map id instead of actual map name
        And you may having problem if you used old pattern files
        • "customs" => "bigmap"
        • "reserve" => "rezervbase"
        • "factory_day" => "factory4_day"
        • "factory_night" => "factory4_night"
        • (You can check in the /Aki_Data/Server/database/locations folder)
    • Supported "akiVersion": 3.1.x
  • Version 2.0.3

    • Changed "Lua-Default.json"
      • Removed "pmc_behavior_role"
      • Default "showTypeInNickname" value to false
    • Fixed "EscapeTimeLimit"
    • Fixed "BossLocationSpawn"
      • v2.0.1 users must update the mod
    • Supported "akiVersion": 3.1.x
  • Version 2.0.1

    • Fixed spawn waves were not applied on the server
      • v2.0.0 users must update the mod
    • Supported "akiVersion": 3.1.x
  • Version 2.0.0

    • Updated for Typescript
    • Refactored code a bit or more
    • Added "Enabled" in config, default is false
    • Added "UseDefaultSpawns" and "UsePatternSpawns" in config for pattern/default uses control
      • UseDefaultSpawns: Uses EFT default spawns
        UsePatternSpawns: Uses Pattern json spawns
      • You may have more bosses if you set true both "Bosses"
      • And same rules applied on "TriggeredWaves"
      • "Waves" are include every other spawns (PMC, Scav, Sniper Scav, Raider)
      • For example, If you want to use SPT's live-like boss spawns only, no boss waves from pattern json?
        UseDefaultSpawns.Bosses: true
        UsePatternSpawns.Bosses: false
      • Last example, If you want mixed-chaos experience by default waves and pattern waves?
        UseDefaultSpawns.Waves: true
        UsePatternSpawns.Waves: true
    • Updated Lua-Default pattern json and renames
      • "gifter" is still on bussiness without costumes and included as Boss, he never gives back though.
      • All bosses with random followers in all maps by very low chance but watch out in the lab
      • Since no longer need to add default bosses on our own, Bosses and Triggered Waves are wiped out and Random boss is remain
      • Added "usec_type" and "bear_type" in pattern json
      • Added "random_time_spawn" for Boss spawns (by BSG), It adds random 0 ~ 20 seconds delay to spawn
      • Renamed "triggered_raider_waves" to "triggered_waves"
      • Fixed typo for "pmc_showTypeInNickname" and renamed to "showTypeInNickname"
      • To be inform, Every bots difficulties are same unless you changes the type files or using mods like FAIT
        Technically (easy == impossible)
        to change bot difficulty check Aki_Data/Server/database/bots/types/%BOT_TYPE%.json
    • Updated ReadMe.txt but still little bit outdated
    • Fixed sniper scav waves may not generated correctly
    • Fixed cringe typos for boss waves and other lines, previously may not work correctly
    • Removed "script_file" from pattern json since no one uses or make own script and share
    • Supported "akiVersion": 3.1.x
  • Version 1.4.1

    • Added new config for "usec_default_enemy" and "bear_default_enemy" in pattern config
    • Supported "akiVersion": 2.2.x
  • Version 1.4.0

    • Fixed triggered waves (button/switch) and reserve, lab switch/buttons
      • No needs to use Chomp's Raider Fix mod but will be fine to use both mod
    • Fixed bug for bosses spawn location when spawn location used "evenly" method
    • Changed bosses esscort amount for multiple waves
      • Instead of same amount of esscort for whole waves, numbers are randomized everytime
    • Added new config "chanceSameSideIsHostilePercent" for PMC bots
    • Added "Gifter" as boss in all maps with very little chance
    • Added "LightLoothouse" map spawn wave template to Lua-Default pattern
      • Rogues are spawned in default locations just like vanllia
    • Supported "akiVersion": 2.2.x
  • Do not disable Boss Enable in Game Raid Setting
    Disable has_boss in patterns config instead

    :!:Error from Others config won't be answered in here, ask the problem in their mod page

    :!:Please check the config.json and pattern config files include Readme file before asking

    Question that explained in Readme file won't be answered from me as well.

    No longer comment supports from author

    You may ask me in SPT Discord but no gurantee for answer or help

  • To the blackscreen issue on death and extract:

    It seems to be an issue with the raider waives. The only thing which seems to help is to delete the raider waves from the pattern. I also read, that the raiders are still working in Labs and are not relying on the raider waves from this mod.

  • I keep getting this in the server and the raid will get stuck at 0.00 when trying to load into the raid

    no bot cap found for Lighthouse, using default}

    TypeError: Cannot read properties of undefined (reading 'replace')

    TypeError: Cannot read properties of undefined (reading 'replace')

    at HttpResponseUtil.clearString (C:\snapshot\project\obj\utils\HttpResponseUtil.js)

    at HttpResponseUtil.noBody (C:\snapshot\project\obj\utils\HttpResponseUtil.js)

    at BotCallbacks.getBotCap (C:\snapshot\project\obj\callbacks\BotCallbacks.js)

    at RouteAction.action (C:\snapshot\project\obj\routers\dynamic\BotDynamicRouter.js)

    at BotDynamicRouter.handleDynamic (C:\snapshot\project\obj\di\Router.js)

    at Proxy.handleRoute (C:\snapshot\project\obj\routers\HttpRouter.js)

    at Proxy.getResponse (C:\snapshot\project\obj\routers\HttpRouter.js)

    at AkiHttpListener.getResponse (C:\snapshot\project\obj\servers\http\AkiHttpListener.js)

    at AkiHttpListener.handle (C:\snapshot\project\obj\servers\http\AkiHttpListener.js)

    at HttpServer.handleRequest (C:\snapshot\project\obj\servers\HttpServer.js)

    TypeError: Cannot read properties of undefined (reading 'replace')

    TypeError: Cannot read properties of undefined (reading 'replace')

    at HttpResponseUtil.clearString (C:\snapshot\project\obj\utils\HttpResponseUtil.js)

    at HttpResponseUtil.noBody (C:\snapshot\project\obj\utils\HttpResponseUtil.js)

    at BotCallbacks.getBotCap (C:\snapshot\project\obj\callbacks\BotCallbacks.js)

    at RouteAction.action (C:\snapshot\project\obj\routers\dynamic\BotDynamicRouter.js)

    at BotDynamicRouter.handleDynamic (C:\snapshot\project\obj\di\Router.js)

    at Proxy.handleRoute (C:\snapshot\project\obj\routers\HttpRouter.js)

    at Proxy.getResponse (C:\snapshot\project\obj\routers\HttpRouter.js)

    at AkiHttpListener.getResponse (C:\snapshot\project\obj\servers\http\AkiHttpListener.js)

    at AkiHttpListener.handle (C:\snapshot\project\obj\servers\http\AkiHttpListener.js)

    at HttpServer.handleRequest (C:\snapshot\project\obj\servers\HttpServer.js)

    know what could fix this or what the cause could be?

    • From when are your pattern? Is there the new lighthouse map missing? Or check the wave amount.

  • Played Woods with only BossKojaniy allowed and killed one shturman up at BigRocks and died to a 2nd shturman in woodcutter camp, black screen and had to alt-F4

  • Question - short version:
    Are the server crashes fixed?

    Long version:
    I've read through this comments thread and I noticed people have problems with server crashes. On Sep 16th you mentioned that most likely SPT needs an update, but the latest version is from Sep 11th. Is it safe to assume that the issue was not resolved yet? Should I skip your mod for now and come back later for it?

    If so could you just help me with one thing in vanilla SPT? I had a situation on Shorline burning gas station .(and only there). After I clear out scavs and PMC and go looting, new PMC spawns RIGHT on me. I hear no call out, no steps from a distance. I only hear them when they are right next to me. Usually when I loot. I am thinking about turning of waves for this map. Which entries in the base.jason should I edit?

    Thanks in advance.

  • This might be a silly question since you made both mods, Lua, but is this compatible with your Custom Spawn Points mod? Felt like CSP overrode Spawn Rework and did indeed use the additional locations, but ignored any tweaks made to waves with this mod as a result.

  • Just bumping what everyone else has been saying, server just dies on most maps excluding factory. Had no issues with a lighthouse run then black screen right at the end.

  • Does changing the difficulty in game from "as online" to "easy" change anything?

  • i have this mod installed, only this mod and i keep getting this :

    Mod Lua-SpawnRework is missing package. json

    Invalid mod (lua-SpawnRework) encountered

    is there a way i can fix this?

  • Black Screen and client freeze on raid exit, on most maps (exclude Factory) (

  • Seems to break servers, crashing the client. I reported it to be an SPT bug but turns out it's spawn rework causing this. Here are some logs and report;
    • Same here, just hard crashes the server.

  • Hey Lua i got this error message, how can i fix/solve it ?

    Error: Unsupported issue: Expected "," or "]" but "t" found. (please open an issue at the repo)

    Error: Unsupported issue: Expected "," or "]" but "t" found. (please open an issue at the repo)

    at runFixer (F:\Escape From Tarkov\node_modules\json-fixer\index.js:89:16)

    at fixJson (F:\Escape From Tarkov\node_modules\json-fixer\index.js:101:21)

    at fixingTime (F:\Escape From Tarkov\node_modules\json-fixer\index.js:111:11)

    at checkJson (F:\Escape From Tarkov\node_modules\json-fixer\index.js:144:12)

    at JsonUtil.deserialize (F:\Escape From Tarkov\obj\bundle.js:20055:99)

    at Mod.GetModConfig (F:\Escape From Tarkov\user\mods\Lua-SpawnRework\src\mod.js:166:36)

    at Mod.LoadModConfig (F:\Escape From Tarkov\user\mods\Lua-SpawnRework\src\mod.js:146:29)

    at Object.action (F:\Escape From Tarkov\user\mods\Lua-SpawnRework\src\mod.js:55:26)

    at $79469d862e09d5e9$export$1d24e66a30f2c3c6.handleStatic (F:\Escape From Tarkov\obj\bundle.js:15208:61)

    at Proxy.handleRoute (F:\Escape From Tarkov\obj\bundle.js:15524:41)

    • I'm not sure but it's probably a typo mistake you could have done when editing the config. you removed a "]" or a "," somewhere by mistake probably at the end of a line.

    • im using the default settings, i havent edited anything, could be some kind of mods conflict ?

  • I'm trying to figure out how to make Lua Spawn rework to work with Fins AI Loader (FAIL). In Lua Spawn Rework, there is pmc_type settings, for customs f.e.: "usec": "pmcBot", "bear": "followerTest". In FAIL there is "PMC = bear, usec" in bot difficulties. Should I change Lua Spawn rework config to this? "usec": "usec", "bear": "bear" ? Also In server console I can see assaultGroup is spawned in PMC part.

  • Boss Knight spawning 100% of the time at meteor station on shoreline despite only boss sanitar being allowed per the edited default pattern



    Also as noted a lot of black screen extracts, just tried removing the mod, booting the server, then downloaded a fresh copy of the mod and ran the server, got this in the server file:

    Loading: Lua-SpawnRework 2.1.2

    Detected faulty json, please fix your json file using VSCodium

    • you have an faulty json config somewhere else that need to fix

    • When I remove spawn rework from my mods list and launch the server I no longer throw that error code again, it's something in SR that is persists with redownloading the newest version

    • There is none of them to be faulty on 2.1.2, you have to fix it on your own though.

      Best guess is where you edited json files.

  • When will there be an update? The server also freezes at the beginning of the raid...

  • Could you tell me how to use correctly "spawn_locations" and "difficulty" parameters?

    What are min and max values (that represent chances) for them?

  • I guess current bot/server issues are related to this tweet -

    External Content
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

    Wait for spt update

  • If you have a server crash on startup check that no other mods is conflicting, like KMC Server Value Modifier (turn off the Bots tab in your preset, other tabs is ok)

    • black screen with every extract using most recent SR mod, reddit shows removing SR fixes black screen extracts. this needs an update

  • How do I use the triggered_waves section? I want to have the D2 lever spawn a tagilla to come rustle my jimmies. Do I just copy the section under boss to triggered_waves?

  • Found a bug) The server started to hang up with this mod again bots are not generated. Out of 15 raids, 7 are not working.

    • on mid-raid or beginning of the raid?

    • At the very beginning of the raid! It just freezes! And the exit from the raid does not work, since the server is hanging)

    • Hey fam, which mods are you using? had the same issue yesterday but i reinstalled aki 3.2.3 plus this mod, KMC server modifier and Market price updater and all good so far, but yea i experienced exactly the same issue, server got frozen when spawning bots and was unable to extract cuz the server practically crashed

    • will take some testing later on, if you found any infos about it then post here

    • Can confirm, the server will call "[Client Request] /client/game/bot/generate" 4-5 times and then hang. Easy to tell if it happens at the beginning of a raid because the keepalive ticks will stop occuring. And obviously no bots will spawn. (launcher/server/version and launcher/profile/info) which happen periodically as long as the launcher is open will also stop.

      The biggest issue is that this hang can also occur while or shortly before extracting/dying/quitting out.

      Sadly the server doesn't error out so there are no logs to show for it.

  • with the boss setting it has "normal, hard" so if wanted them just normal it would have to be "normal"

    • Yes and "normal, hard" will be 5:5 chance to pick one.

    • thanks for reply

  • seeing as i use Server Value Modifier, i take it i would de-select the bot selection in that to use this mod?

  • Whenever I use this mod PMCs or Scavs never spawn at all. I've tried multiple different maps. I am using LuaCustomSpawnPoints, LuaFleaMarketPriceUpdater, Valens AIO, and Fins AI Tweaks with the config edited to turn off spawn tweaks.

    • I have just SR installed and if i try setting scav waves to 0 or even 1 and 0 or 1 instant wave also, I still get a ton of scavs spawning. Attempting to reduce scavs for shooter born in heaven with PMC waves turned up and increased chances at certain locations but I'm getting flooded with scavs. No other mods for editing AI spawns.

    • That's weird....I did exactly what you did and set all scav waves to 0 and only got pmc bodies on factory.

  • Hello,

    when i launch a game i get this error : (this is a big one)

    The consequence seems that no IA spawn ingame. It's an empty game when this happen.

    • I have the same issue but so far only on customs and I have no idea how to fix this. Factory works normally so far, haven't tested the other maps yet.

    • Factory is Okay

      Got it on custom too and on Lighthouse.

      I can guess that this

      > TypeError: Cannot read property '2' of undefined

      Is stopping AI from spawning when looking at


      at Function.generateBots (C:\Users\Romain\Desktop\SPT AKI\user\mods\zFin-AITweaks\src\mod.js:1657:27)

      at Function.onBotGen (C:\Users\Romain\Desktop\SPT AKI\user\mods\zFin-AITweaks\src\mod.js:182:27)

      Alas maybe Lua know what's up and that would spare me a headache.

      EDIT :

      Oooh i just realised this is not a LUA Spawn mod's problem but a zFin AITweaks one ...

      SORRY ! This was under my dumb nose.

  • I have a problem with LSR, when i turn "Enabled" from "false" to "true"

    EnhandledPromiseRejectionWarning: Error: Attempted to Resolve unregistered dependency token: "ApplicationContext"

    at InternalDependencyContainer.resolve (G:\Programm Files (x86)\EscapeFromTarkov\node_modules\tsyringe\dist\cjs\dependency-container.js:105:19)

    at Mod.postDBLoad (G:\Programm Files (x86)\EscapeFromTarkov\user\mods\Lua-SpawnRework\src\mod.js:31:46)

    at PostDBModLoader.executeMods (G:\Programm Files (x86)\EscapeFromTarkov\obj\bundle.js:12688:45)

    at PostDBModLoader.onLoad (G:\Programm Files (x86)\EscapeFromTarkov\obj\bundle.js:12672:45)

    at App.load (G:\Programm Files (x86)\EscapeFromTarkov\obj\bundle.js:16705:95)

    at G:\Programm Files (x86)\EscapeFromTarkov\obj\bundle.js:18392:47

    at processTicksAndRejections (internal/process/task_queues.js:93:5

    SPT-AKI 3.2.1, LSR 2.1.1

  • Will you add a "chance of daytime cultist" parameter in order to use with your daytime cultist mod ?

    (Love your mod btw, essential to me !!)

    • There is no need to add from spawn mod, adds cultists boss spawn and install cultists patcher mod is all.

      It also spawns from map's default boss spawns (probably), therefore no needs to add unless you want to add somewhere else than usual spawn points.

  • Heya Lua,

    noticed you recently updated the PMC Behaviors from "pmc_behavior_role" to "usec_type"/"bear_type" which use different behavior profiles, by default it is now set to ExUSEC and FollowerBigPipe respectively compared to previously being pmcBOT.

    What kind of difference does this make in general to the way PMCs behave and what other options do i have when it comes to selecting behavior patterns/profiles as theres nothing about it in the config readme.

    Also nomatter what i change in the config file, all PMCs are hostile regardless of if i have set "chanceSameSideIsHostilePercent" to 0 and default_enemy_(pmcgroup im using) to false

    this is for that latest version of the mod and AKI-SPT released.


    • I heard "chanceSameSideIsHostilePercent" is bugged at this moment.

      There is nothing much say about PMC role config, It uses configured role that every bot has unique AI and behavior, as example and spt's default - exUsec and BigPipe is rushing type of boss/follower.

      If you want old ways PMC behave, might wanna try pmcBot.

  • What should I set for AI amount In-Game?

    • As-Online is recommended.

  • Bruh how can I fix every pmc or raider sprinting towards me (knowing where i am) like there's no tomorrow?

    • Change behave role in the pattern config.

      Thumbs Up 2
    • Hi, Lua.

      Have the same kamikaze-style behavior. What option in the pattern config must be changed for this exactly?

      Is it "bear_type" and "usec_type" options?

      And thanks, great mod!

  • When I start a raid It's just doesnt generate the spawns and freezes at 0 spawntime.

    • Check the server/client error logs.

  • One of the best mods, can't play without it !!

  • good with scheduling bot throughout the whole raid and supposed it improved my fps

    :love::thumbup:<3 guud

  • Excellent customization of bot spawns

    it allows you to edit nearly everything related to bot spawning, from how many PMCs to SEPARATE (and this cannot be stressed enough) boss spawning rates (including the prewipe boss meeting event) in all the maps

    having cultists in Factory night is hilarious as hell

    also I tested it in 2.0.0A5, works perfectly so I guess we're very close to the 12.11 stable release :DDDD

    excellent work!!!

  • Good performance; varied spawns.

    Scav spawns are well paced and varied. Big plus is it does not affect performance much.