Garry's Mod Wiki

Revision Difference

Player:GetCount#560258

<function name="GetCount" parent="Player" type="classfunc"> <description>Gets total count of entities of same type. <description><note>This function is only available in Sandbox and its derivatives.</note>Gets the total amount of entities of an entity type added by <page>Player:AddCount</page>. Default types: ``` balloons buttons cameras dynamite emitters hoverballs lamps lights props ragdolls thrusters wheels ```</description> <realm>Shared</realm> <file line="34-L70">gamemodes/sandbox/gamemode/player_extension.lua</file>⤶ <args> <arg name="type" type="string">Type to get entity count of.</arg> <arg name="minus" type="number" default="0">If specified, it will reduce the counter by this value. Works only serverside.</arg> </args> <rets> <ret name="count" type="number">The returned count.</ret> </rets> </function> <example> <code> print( Entity(1):GetCount("props") ) </code> </example>