Garry's Mod Wiki

Revision Difference

Entity:GetBodygroup#544779

<function name="GetBodygroup" parent="Entity" type="classfunc"> <description>Gets the exact value for specific bodygroup of given entity.</description>⤶ <description>Gets the exact value for specific bodygroup of given entity.<note>If called for Weapon with different body groups on world model and view model will return value form view model.</note>⤶ </description>⤶ <realm>Shared</realm> <args> <arg name="id" type="number">The id of bodygroup to get value of. Starts from 0.</arg> </args> <rets> <ret name="" type="number">Current bodygroup. Starts from 0.</ret> </rets> </function> <example> <description>Gets the value of bodygroup 2 of entity player 1 is aiming at.</description> <code>print( Entity(1):GetEyeTrace().Entity:GetBodygroup(2) )</code> <output>"1" in console, if player 1 is aiming at airboat.</output> </example>