Garry's Mod Wiki

Revision Difference

Entity:GetHitBoxCount#528590

<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 group.</description>⤶ <realm>Shared</realm> <args> <arg name="group" type="number">The number of the hit box group</arg>⤶ <arg name="group" type="number">The number of the hit box group.</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 groups.</description>⤶ <code> local numHitBoxGroups = LocalPlayer():GetHitboxSetCount() for i=0, numHitBoxGroups - 1 do for i = 0, numHitBoxGroups - 1 do local numHitBoxes = LocalPlayer():GetHitBoxCount( i ) print("Hit box group " .. i .. " has " .. numHitBoxes .. " hit boxes!") print( "Hit box group " .. i .. " has " .. numHitBoxes .. " hit boxes!" ) end </code> <output>"Hit box group 0 has 17 hit boxes!"</output>⤶ ⤶ </example> <output>Hit box group 0 has 17 hit boxes!</output>⤶ </example>