Skip to content

EntityList

Functions


GetEntity()

Parameters

Parameter Type Description
player_index int Entity index

Return value

Parameter Type Description
player CBaseEntity Returns CBaseEntity instance
Example
1
2
3
  for i = 1, EngineClient:GetMaxClients(), 1 do
    local entity = EntityList:GetEntity(i)
  end

GetHighestEntityIndex()

Return value

Parameter Type Description
index int Returns the index of the last entity, this entity is not necessarily a player. Can be used to look for entities of specific types
Example
1
2
3
4
5
6
7
8
9
  Cheat.RegisterCallback("render", function()
    for i = 1, EntityList:GetHighestEntityIndex(), 1 do
    local entity = EntityList:GetEntity(i)
      if entity:GetClassId() == 36 then
        -- This will only execute for CChicken entities
      end
    end

  end)