Garry's Mod Wiki

ents.FindInSphere

  table ents.FindInSphere( Vector origin, number radius )

Description

Gets all entities within the specified sphere.

Serverside, this uses a Spatial Partition internally to avoid looping through all entities, so it is more efficient than using ents.GetAll for this purpose.

Clientside, this function internally calls util.IsBoxIntersectingSphere

Arguments

1 Vector origin
Center of the sphere.
2 number radius
Radius of the sphere.

Returns

1 table
A table of all found Entitys.