NPC.PlayScene

From GMod Wiki

(Redirected from Player.PlayScene)
Jump to: navigation, search
Function
Syntax NPC:PlayScene( String Animation )
Description:
Lets an npc play a specific scene from a .vcd.
Returns: nil
In Object: Npc
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=NPC.PlayScene]NPC.PlayScene [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionMakes the NPC play a scene, when she sees a player.
Used onNewerServer.png
Code
 
function ENT:OnCondition( iCondition )
	if self:ConditionName(iCondition) ==  "COND_SEE_PLAYER" and haveSeenAPlayer != 1 then
 
		haveSeenAPlayer = 1
		self:PlayScene("scenes/npc/female01/overhere01.vcd")
 
	elseif self:ConditionName(iCondition) ==  "COND_LOST_PLAYER" then
 
		haveSeenAPlayer = 0
 
	end
end
 
OutputThe NPC starts yelling "Overhere!".


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox