Garry's Mod Wiki

Entity:PlayScene

  number, Entity Entity:PlayScene( string scene, number delay = 0 )

Description

Makes the entity play a .vcd scene. All scenes from Half-Life 2.

Arguments

1 string scene
Filepath to scene.
2 number delay = 0
Delay in seconds until the scene starts playing.

Returns

1 number
Estimated length of the scene.
2 Entity
The scene entity, removing which will stop the scene from continuing to play.

Example

Makes the NPC that the player 1 is looking at play the Welcome to City 17 speech.

local entity = Entity( 1 ):GetEyeTrace().Entity if ( entity:IsValid() and entity:IsNPC() ) then entity:PlayScene( "scenes/breencast/welcome.vcd" ) end
Output: The entity plays the scene.