Garry's Mod Wiki



  Entity:SetKeyValue( string key, string value )


Sets Hammer key values on an entity.

You can look up which entities have what key values on the Valve Developer Community on entity pages.

A list of basic entities can be found here.

Alternatively you can look at the .fgd files shipped with Garry's Mod in the bin/ folder with a text editor to see the key values as they appear in Hammer.


1 string key
The internal key name
2 string value
The value to set


Makes an NPC not drop his weapon and drop a healthkit on death, using SF Enumerations on a Combine Soldier.

A list of spawnflags a Combine Soldier has can be found here.

npc:SetKeyValue( "spawnflags", bit.bor( SF_NPC_NO_WEAPON_DROP, SF_NPC_DROP_HEALTHKIT ) )

Special Pages



Render Time: 27ms

DB GetPage 6
Generate Html 4
SaveChanges (1) 6
Render Body 0
Render Sidebar 8