Entity/SetKeyValue

From Garry's Mod
Jump to: navigation, search
 Entity:SetKeyValue( )

Contents

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

string key

The internal key name

Arguments

string value

The value to set

Examples

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


Personal tools
Navigation