nanos world API Reference Unofficial documentation
Static function Shared Fast

Entity.GetPairs

Returns an iterator with all Entities of this class to be used with <code>pairs()</code>. This is a more performant method than <code>GetAll()</code>, as it will return the iterator to access the Entities directly instead of creating and returning a copy of the Entities table.<br><br><b>Note:</b> Destroying Entities from inside a <code>GetPairs()</code> loop will cause the iterable to change size during the process. If you want to loop-and-destroy, please use <code>GetAll()</code>.

Syntax

Lua
Entity.GetPairs()

Returns

  • iterator Iterator with all Entities of this class