Garry's Mod Wiki

Garry's Mod Wiki

  number WEAPON:TranslateActivity( number act )

Description

Translate a player's Activity into a weapon's activity, depending on how you want the player to be holding the weapon.

For example, ACT_MP_RUN becomes ACT_HL2MP_RUN_PISTOL.

Arguments

1 number act
The activity to translate

Returns

1 number
The translated activity

Example

Default action

function SWEP:TranslateActivity( act ) if ( self:GetOwner():IsNPC() ) then if ( self.ActivityTranslateAI[ act ] ) then return self.ActivityTranslateAI[ act ] end return -1 end if ( self.ActivityTranslate[ act ] != nil ) then return self.ActivityTranslate[ act ] end return -1 end

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...