Player.SetAnimation

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player.SetAnimation( Integer PLAYER_* enum )
Description:
Sets a player's animation
Returns: nil
In Object: Player
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.SetAnimation]Player.SetAnimation [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionUsed in a SWEP, this make the player model do the attacking animation when a shot is fired.
Used onNewerServer.png
Code
 
 function SWEP:ShootEffects() 
 
 	self:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) 		// View model animation 
 	self.Owner:MuzzleFlash()								// Crappy muzzle light 
 	self.Owner:SetAnimation( PLAYER_ATTACK1 )				// 3rd Person Animation 
 
 end
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox