Getting entity by index (without for loop)

Hello. For one of my projects, I need to get a lua entity by it’s index, and for reasons I will not get into, I cannot solve this problem by iterating through the ents.GetAll table with a for loop and waiting until k is equal to my ent’s index.

To further illustrate my question, let’s assume LocalPlayer’s index is currently 43. How would I do something along the lines of this:


print(ents[43]:Nick())

Thanks.

Maybe



ents.GetByIndex(43)


Edit: even better:



Entity(43)


Second one is perfect, thanks Lenny.