Garry's Mod Wiki

Entity:GetBodygroup

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.

print( Entity(1):GetEyeTrace().Entity:GetBodygroup(2) )
Output: "1" in console, if player 1 is aiming at airboat.

Special Pages


Wikis

?

Render Time: 69ms

DB GetPage 49
Generate Html 3
SaveChanges (1) 6
Render Body 0
Render Sidebar 8