A standalone bot addon with navmesh AI, Red vs Blue teamplay, configurable loadouts, an admin menu with 3D previews, and a comprehensive hook API for gamemode integration.
Navmesh pathfinding, target acquisition, weapon switching, reloading, and obstruction handling across four difficulty levels.
Full team mode with join screen, force-team, auto-balance, and team-aligned NPC relationships.
Named weapon loadouts scoped to Global, Red, or Blue. Bots randomly pick an enabled loadout at spawn.
38 serverside hooks covering creation, targeting, movement, damage, freezing, waypoints, and more.
In-game GUI with ConVar controls, loadout editor with live 3D weapon preview, playermodel viewer, and per-bot management.
Freeze individual bots with bot_freeze <name> or via the Bots tab, independent of the global bot_stop.
Set custom starting health and armour via bot_health and bot_armor ConVars. Persists across saves.
Bundled TFA patch silences viewmodel errors. Bots carry and fire TFA weapons without server crashes.
All settings, loadouts, and playermodels persist to disk. Auto-load on every map start with bot_autoload.
All ConVars are admin-only. Configure them visually with bot_menu and persist changes with bot_data_save.
bot_add_fill.GBots_OnBotWaypoint hook.bot_add · bot_add_red · bot_add_blue · bot_add_fill · bot_kick [name] · bot_kill [name|all] · bot_place · bot_freeze <name> · bot_unfreeze <name> · bot_freeze_all · bot_unfreeze_all · bot_freeze_list · bot_data_save · bot_data_load · bot_data_delete · bot_menuhook.Add( "HookName", "MyAddon_Tag", function(...) end ). Return values override default behaviour where documented. NEW = added in the enhanced update.| Hook | Arguments | Returns | Description |
|---|---|---|---|
GBots_CanBotBeCreated | teamid | false to block | Return false to prevent bot creation. Useful for custom quota or mode restrictions. |
GBots_OnBotCreated | bot, teamid | — | Fired after a bot entity is created and added to the bot list. |
GBots_OnBotKicked | bot | — | Fired just before a bot is kicked from the server. |
GBots_OnBotSpawned | bot | — | Fired after a bot spawns or respawns and receives its loadout. |
GBots_OnBotDeath | bot, attacker | — | Fired when a bot dies. Attacker may be nil. |
GBots_OnBotDamaged | bot, dmg | false to suppress | Fired on damage. Return false to prevent automatic target-set reaction. |
GBots_GetRespawnDelay | bot | number (seconds) | Override how long a bot waits before respawning. Default 1 second. |
GBots_OnTeamAssigned | bot, teamid | — | Fired when a bot is assigned to Red or Blue team. |
GBots_OnBotTeamKillNEW | bot, victim | — | Fired when a bot kills a teammate in teamplay mode. |
GBots_OnBotFrozenNEW | bot, isFrozen | — | Fired when a bot is individually frozen or unfrozen via bot_freeze / bot_unfreeze. |
| Hook | Arguments | Returns | Description |
|---|---|---|---|
GBots_GetSpawnPoint | bot, teamid | Entity | Return a spawn point entity to override the default picker. |
GBots_GetBotName | teamid | string | Return a string to override the name assigned to a new bot. |
GBots_GetPlayerModel | bot, teamid | string (model path) | Return a model path to override the playermodel on spawn. |
GBots_GetLoadout | bot, teamid | table of classnames | Return a weapon class table to completely override the loadout system. |
GBots_OnLoadoutGiven | bot, weapons | — | Fired after weapons are given. weapons is the table that was used. |
| Hook | Arguments | Returns | Description |
|---|---|---|---|
GBots_CanTarget | bot, target | false to block | Return false to prevent this bot from targeting a specific entity. |
GBots_OnTargetFound | bot, target | — | Fired when a bot acquires a new target. |
GBots_OnTargetLost | bot, target | — | Fired when a bot loses sight of its current target. |
GBots_CanAttack | bot, target | false to block | Return false to prevent a bot from firing at its target this tick. |
GBots_OnBotAttackNEW | bot, target, weapon | — | Fired each time a bot fires at its target. Includes the active weapon entity. |
GBots_OnBotReloadNEW | bot, weapon | — | Fired when a bot begins reloading a weapon. |
GBots_OnBotSwitchWeaponNEW | bot, oldWep, newWep | — | Fired when a bot selects a new active weapon. oldWep may be invalid. |
GBots_OnWeaponDrop | bot, weapon | — | Fired just before a bot drops a weapon that has run out of ammo. |
GBots_GetNPCDisposition | bot, npc | D_* constant | Return D_HT, D_LI, or D_NU to override NPC-to-bot relationships. |
GBots_OnObstructionFound | bot, ent, isDoor | false to ignore | Fired when a blocking prop or door is detected. Return false to skip attacking it. |
GBots_CanPickupItemNEW | bot, item | false to block | Return false to stop a bot from pathing toward a specific item or weapon pickup. |
| Hook | Arguments | Returns | Description |
|---|---|---|---|
GBots_CanMoveNEW | bot | false to freeze | Return false each tick to freeze this specific bot in place. |
GBots_CanRoamNEW | bot | false to stop | Return false to prevent a bot from roaming when it has no target. |
GBots_GetMoveSpeedNEW | bot | number | Return a forward move speed value to override this bot's movement this tick. |
GBots_CanJump | bot | false to block | Return false to prevent the bot from jumping on navmesh jump links. |
GBots_CanCrouchNEW | bot | false to block | Return false to prevent the bot from crouching even in NAV_MESH_CROUCH areas. |
GBots_GetRoamTarget | bot | Vector or Entity | Return a Vector or Entity to guide roaming instead of a random navmesh area. |
GBots_OnPathComputed | bot, path | — | Fired after a new navmesh path is computed while chasing a target. |
GBots_OnBotStuck | bot | — | Fired when stuck detection triggers and the path is invalidated. |
GBots_OnBotWaypointNEW | bot, pos | — | Fired when a bot reaches its path goal. Requires bot_waypoint_notify 1. |
| Hook | Arguments | Returns | Description |
|---|---|---|---|
GBots_OnMenuOpened | ply | — | Fired when an admin opens the bot menu. |
GBots_OnSettingsSaved | — | — | Fired after all settings are written to disk. |
GBots_OnSettingsLoaded | — | — | Fired after settings are read from disk. |
GBots. Use GBots.List to iterate all active bots. Set GBots.Frozen[bot] = true to freeze a bot programmatically.G-Bots hooks are serverside. Create a file under lua/autorun/server/ in your addon folder.
The global GBOT_TEAM_RED only exists when G-Bots is loaded. Always check it before registering hooks.
Always use your addon name as the tag to avoid conflicts with other addons using the same hook.
Hooks documented with a Returns value will use your return to change G-Bots behaviour. Return nil or nothing to use the default.
The GBots global gives you direct programmatic control over all bots.
Real patterns you can copy and adapt. All examples guard against G-Bots not being installed.