This article's documentation is for anything that uses the Source engine. Click here for more information.

ent_keyvalue

From Valve Developer Community
Jump to navigation Jump to search
English (en)Translate (Translate)

ent_keyvalue is a console command available in all Source Source games. It can change chosen entity's keyvalues.

Syntax: ent_keyvalue <entity id> <key> <value> [<key> <value>...]

  • if <entity id> is "" or !picker the picker entity will be used
  • if <entity id> is !self / !activator / !caller the player that issued the command (works in multiplayer?[confirm])
  • if <entity id> is hammer id then the entity will be searched by hammer id
Note.pngNote:If space needs to be used as some <value> make sure to enclose the value in quotes.
Example ent_keyvalue 848668 message "This is game_text's message keyvalue"
Note.pngNote:This is using entity's KeyValue method to change keyvalues which means it's equivalent to changing keyvalues via AddOutput and it can even add outputs.
Example of adding outputs to the command issuer ent_keyvalue !self OnUser1 !self,Kill,,5,-1 OnUser2 "game_text,AddOutput,message changing a message of game_text". (difference from AddOutput syntax is needing to use symbol , instead of :)

See also