SWEP.ShootEffects

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NameShootEffects
SyntaxSWEP:ShootEffects( )
DescriptionTriggers the firing animation and produces muzzle flash effects.
ReturnsNil
Lua StateNewerShared.png
BBCode[b][url=wiki.garrysmod.com/?title=SWEP.ShootEffects]SWEP.ShootEffects [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Definition of the function

Because it is a convenience function, it is defined by the game.(Source 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

Examples

DescriptionAnimations to throw a grenade.
Used onNewerShared.png
Code
function SWEP:ShootEffects()
	self:SendWeaponAnim( ACT_VM_THROW )		// View model animation
	self.Owner:SetAnimation( PLAYER_ATTACK1 )	// 3rd Person Animation
end
OutputN/A


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox