Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
VGSources
Blog

How to Spawn NPCs in Garry’s Mod

Hold Q to open the Spawn Menu, find an NPC, and left-click to spawn it where you are aiming. Addon authors can register NPCs or create entities with Lua.
WorldGarry's Mod Length2 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In Sandbox, hold Q to open the Spawn Menu, find an NPC, then left-click it to spawn it where you are aiming. If Q does not open the menu, use the key assigned in Game Options. You do not need Lua to spawn an NPC already listed in the menu.

Spawn an NPC from the menu

  1. Hold Q to open the Spawn Menu. If you have changed the binding, use the key assigned in Game Options.
  2. Locate an NPC entry in the menu.
  3. Left-click the entry to spawn the NPC where you are aiming. Right-click an item to open its options when available.

The Garry’s Mod Wiki describes the menu as containing “all models, weapons, NPCs, entities and tools you can use in your game” (Opening The Spawnmenu). The exact NPC entries available can vary by installation, gamemode, and branch; there is no verified universal roster. Citizens, Combine Soldiers, and Striders are examples, not a complete list (NPC examples).

Choose the route that matches what you want to do

Goal Route
Spawn an NPC already listed Use the Q menu and left-click its entry.
Add a spawnable NPC to Sandbox for an addon Register NPC data or add an NPC entry to a custom spawnlist.
Create an entity in Lua Use ents.Create with a valid class, then set it up and spawn it.

Register an NPC for Sandbox with Lua

For addon authors, the NPCData reference documents the data used to define spawnable NPCs for Sandbox. Its example registers an entry using list.Set("NPC", ...). The key fields are:

  • Name: the name shown in the menu.
  • Class: the entity classname to spawn.
  • Category: the menu category; it defaults to Other.
  • Weapons and KeyValues: optional NPC configuration fields.

SubCategory was added in version 2026.07.11, and the reference cautions it may only be available on the Dev Branch. Confirm that the target branch supports it before relying on the field.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Tibers Box 2 Lite
  • Import models,texture,emitters
  • Various functions

Use a custom spawnlist instead

For a custom prop-menu spawnlist, spawnmenu.AddPropCategory accepts entries of type npc. Documented fields include spawnname, nicename, and material; optional fields include possible weapons and an admin-only flag. Call it within SANDBOX:PopulatePropMenu. The API documentation warns that addon spawnlists edited this way will not save to disk and advises against changing spawnlists customized by players.

Create an entity by class in Lua

ents.Create creates an entity from a classname. The general pattern is to create it, check that the returned entity is valid, set its position, and call Spawn(). For example:

Rank #2
Allplay Mori Board Game, Full of Tricky, Clever Decisions, 3-5 Players
  • USE YOUR DICE WELL - It’s in the tagline of the game: “Dice Break The Rules.” Being able to choose not to follow the lead suit when it’s advantageous to you can be huge! Don’t ignore collecting dice.
  • MANIPULATE THE X CARDS - Having the most X’s is bad: they each count as one negative point. You might be able to feed your x cards to the perceived scoring leader.
  • HOLDING ONTO CARDS - Because you score cards left in hand, it can be a fun challenge to try and keep well-scoring cards not be pulled out by the trick-taking rules.
  • ART BY BETH SOBEL - "Mori" is the Latin word for death and the Japanese word for forest. Both of these interpretations are represented in the artwork of this card game.
  • PRAISE FOR MORI - "a fresh take on a familiar genre that will be an easy learn for fans of this type of card game." BGG User KRWoods1
local ent = ents.Create("valid_classname")
if IsValid(ent) then
    ent:SetPos(spawnPosition)
    ent:Spawn()
end

This is a generic entity-creation pattern, not a tested NPC-specific script. Use a classname for an NPC available in the target game, then verify that it behaves as intended in the selected gamemode and branch. Entity creation can fail and return NULL if the classname does not exist or the networked-edict limit is reached; the wiki describes that limit as around 8176. Do not call ents.Create before GM:InitPostEntity has run, because the documentation warns this can crash the server (GM:InitPostEntity).

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Prevent players from spawning items

Hiding the Spawn Menu is not sufficient to block spawning: players may still use console commands. The SANDBOX:SpawnMenuOpen documentation points gamemode authors toward GM:PlayerSpawn* hooks for preventing actual spawns. That pointer is not a complete permissions recipe, so implement and test the appropriate spawn hooks for the gamemode and server rules you intend to enforce.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

Bestseller No. 1
Tibers Box 2 Lite
Tibers Box 2 Lite
Import models,texture,emitters; Various functions
Bestseller No. 3
Green monster persecution
Green monster persecution
3d first person horror adventure.; Sound experience
Bestseller No. 4
SaleBestseller No. 5
Rank #3
Green monster persecution
  • 3d first person horror adventure.
  • Adrenaline Rush: Experience the thrill of the chase and the exhilaration of evading a relentless pursuer.
  • With multiple paths to take and secrets to uncover, each playthrough offers a new experience.
  • Sound experience

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Turn On Vibrant Visuals in MinecraftMinecraftBlog3min
  2. Best Multiplayer Games for Low-End PCsBlog4min
  3. Minecraft: How To Use And Install OptiFineBlog5min
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.