NPC.SetExpression
From GMod Wiki
Function | |
Syntax | NPC:SetExpression( String expression ) |
Description: | |
Sets the NPC's facial expression. | |
Returns: | Number |
In Object: | Npc |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=NPC.SetExpression]NPC.SetExpression [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Makes a citizen scared |
---|---|
Used on | |
Code | ents.FindByClass( "npc_citizen" )[1]:SetExpression( "scenes/Expressions/citizen_scared_idle_01.vcd" ); |
Output | His face becomes frightened. |
Additional Notes
- Should specify a VCD file from scenes/expressions
- Seems to be identical to NPC.PlayScene
- The number returned appears to be the length of the expression - how long it will be before it resets.