Garry's Mod Wiki

Player:GetCount

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

Description

Gets total count of entities of same type.

Default types:

balloons buttons cameras dynamite emitters hoverballs lamps lights props ragdolls thrusters 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") )