Garry's Mod Wiki

Entity:GetBodygroup

  number Entity:GetBodygroup( number id )

Description

Gets the exact value for specific bodygroup of 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 value of. Starts from 0.

Returns

1 number
Current bodygroup. Starts from 0.

Example

Gets the value of bodygroup 2 of entity player 1 is aiming at.

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