CGameEntitySystem

Usage:

Usage: game.gameEntitySystem:{method}

This type encapsulates some entity querying functionalities. If you wish to loop for players, controllers, dropped items or projectiles, go here.

ForEachByClass

Function

Loops for all entities with a given class.

Arguments

Name

Type

Description

className

string

The entity class name

callback

function<C_BaseEntity>

The loop callback

Returns

Nothing.

Example

game.gameEntitySystem:ForEachByClass('C_C4', function(entity)
    if entity.m_bStartedArming:Get() then
        print('Someone is planting!')
    end
end)

GetFirstByClass

Function

Finds and returns the first entity from a specific class.

Arguments

Name

Type

Description

className

string

The entity class name

Returns

Type

Description

The entity, nil if not found.

Example


Last updated