Garry's Mod Wiki

NPC:ConditionID

  number NPC:ConditionID( string conditionName )

Recently Added

This was recently added in version (2025.09.03). It might only be available on the Dev Branch right now.

Description

Returns the ID of a given condition by name. Opposite of NPC:ConditionName.

This is useful for custom conditions defined by engine NPCs, such as COND_ZOMBIE_RELEASECRAB for zombies, and COND_COMBINE_ON_FIRE for Combine Soldiers.

Arguments

1 string conditionName
The condition name.

Returns

1 number
The condition ID, see COND enum. Custom conditions will have a "randomly" assigned IDs, which will change with each game session.