Garry's Mod Wiki

Entity:SetBodyGroups

  Entity:SetBodyGroups( string subModelIds )

Description

Sets the Entity's active Sub Models via a string of Sub Model IDs in order from the first Body Group ID to the last.

This is a convenience function for Entity:SetBodygroup.

When used on a Weapon, this will modify its viewmodel.

Arguments

1 string subModelIds
The Sub Model IDs to activate for each Body Group on the Entity's model.

The first character corresponds with Body Group ID 0, the second character coressponds to Body Group ID 1, etc.

To support Body Groups with more than 0-9 options, values above 9 are represented using alphabetical characters starting with a and ending with z.

Example

Example of the format

Entity(1):SetBodyGroups( "021" )
Output: This makes the following changes:

Body Group ID 0 has Sub Model ID 0 made active.
Body Group ID 1 has Sub Model ID 2 set to active.
Body Group ID 2 has Sub Model ID 1 activated.