Automatically add bots to a Dedicated Server

Continuing the discussion from I want to make mods for S1 in other languages, what do I do?:

HI! I build a local server of S1 by using S1ServerConfigs-main .I want to know how to add bots automatically,like those servers in server list,I can’t find a way to do it ! PLS reply :pray:

Download this file and place it in the scripts folder like this:

Tweak the script as you need

Thanks a lot!! :upside_down_face:,My scripts folder is different.However, there is still a small issue with this script, as it can only automatically add 13 bots each time and cannot add 17 at all. I don’t know why!!

Edit the script to fit your needs

if you dont mind me asking how did you get the bots to have various weapons because all they have is just knives, also how do you change the difficulty?

The autobots snippet mainly fills slots and kicks bots on join; it doesn’t define weapons. Weapons and difficulty are usually set by the bot spawn call or the server’s bot config/dvars, not by onPlayerConnect. Check what spawnBotswrapper(1) wraps and whether that bot spawn function accepts a loadout/weapon and a difficulty argument. If no weapon is assigned, bots will likely fall back to default/melee. Set the desired loadout at spawn and use the difficulty value your server config supports rather than changing the fill loop.