Garry's Mod Wiki

Garry's Mod Wiki

  number NPC:SetExpression( string m_iszExpressionScene )

Description

Sets the NPC's .vcd expression. Similar to Entity:PlayScene except the scene is looped until it's interrupted by default NPC behavior or NPC:ClearExpression.

Arguments

1 string m_iszExpressionScene
The expression filepath.

Returns

1 number flDuration
Default duration of assigned expression, in seconds.

Example

Function which makes the NPC whom the player is looking at repeat an annoying scene.

function GrenadesScene(ply) if(!IsValid(ply)) then return end local npc = ply:GetEyeTrace().Entity if(IsValid(npc) && npc:IsNPC()) then npc:SetExpression("scenes/streetwar/sniper/ba_nag_grenade0"..math.random(1, 5)..".vcd") end end

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...