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 Enums/ACT. 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

Page Links


Special Pages


Wikis

?

Render Time: 41ms

DB GetPage 4
Generate Html 4
SaveChanges (1) 13
Render Body 0
Render Sidebar 16