Garry's Mod Wiki

Weapon:GetActivity

  number Weapon:GetActivity()

Description

Returns the sequence enumeration number that the weapon is playing.

This can return inconsistent results between the server and client.

Issue Tracker: 2543

Returns

1 number
Current activity, see ACT enum. Returns 0 if the weapon doesn't have active sequence.

Example

This will return the ACT_ENUM that is currently active for the weapon.

local wep = Entity(1):GetActiveWeapon() if ( IsValid( wep ) ) then // Makes sure that wep exists print( wep:GetActivity() ) // Prints the sequence number end