Garry's Mod Wiki

Revision Difference

Entity:GetHitBoxCount#552564

<function name="GetHitBoxCount" parent="Entity" type="classfunc"> <description>Gets how many hit boxes are in a given hit box group.</description> <description>Gets how many hit boxes are in a given hit box set.</description> <realm>Shared</realm> <args> <arg name="group" type="number">The number of the hit box group.</arg> <arg name="set" type="number">The number of the hit box set.</arg> </args> <rets> <ret name="" type="number">The number of hit boxes.</ret> </rets> </function> <example> <description>Will print out how many hit boxes the client has in each of their hit box groups.</description> <description>Will print out how many hit boxes the client has in each of their hit box sets.</description> <code> local numHitBoxGroups = LocalPlayer():GetHitboxSetCount() for i = 0, numHitBoxGroups - 1 do local numHitSetGroups = LocalPlayer():GetHitboxSetCount() for i = 0, numHitSetGroups - 1 do local numHitBoxes = LocalPlayer():GetHitBoxCount( i ) print( "Hit box group " .. i .. " has " .. numHitBoxes .. " hit boxes!" ) print( "Hit box set " .. i .. " has " .. numHitBoxes .. " hit boxes!" ) end </code> <output>Hit box group 0 has 17 hit boxes!</output> <output>Hit box set 0 has 17 hit boxes!</output> </example>