Garry's Mod Wiki

Player:GetCount

  number Player:GetCount( string type, number minus = 0 )

Description

This function is only available in Sandbox and its derivatives.

Gets the total amount of entities of an entity type added by Player:AddCount.

Default types:

balloons buttons cameras dynamite effects emitters hoverballs lamps lights npcs props ragdolls sents thrusters vehicles wheels

Arguments

1 string type
Type to get entity count of.
2 number minus = 0
If specified, it will reduce the counter by this value. Works only serverside.

Returns

1 number count
The returned count.

Example

print( Entity(1):GetCount("props") )