Garry's Mod Wiki

Entity:SetKeyValue

Entity:SetKeyValue( string key, string value )

Description

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.

Arguments

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

Example

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 ) )

Page Links


Special Pages


Wikis

?

Render Time: 34ms

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