Garry's Mod Wiki

Entity:GetBodygroupName

  string Entity:GetBodygroupName( number id )

Description

Gets the name of specific bodygroup for given entity.

If called for Weapon (after Initialize hook) with different body groups on world model and view model will return value form view model.

Arguments

1 number id
The id of bodygroup to get the name of.

Returns

1 string
The name of the bodygroup

Example

Demonstrates the use of this function.

Output: "Weapon" in console, if player 1 is aiming at airboat.