• Getting entity by index (without for loop)
    2 replies, posted
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: [CODE]print(ents[43]:Nick())[/CODE] Thanks.
Maybe [code] ents.GetByIndex(43) [/code] Edit: even better: [code] Entity(43) [/code]
[QUOTE=LennyPenny;41487673]Maybe [code] ents.GetByIndex(43) [/code] Edit: even better: [code] Entity(43) [/code][/QUOTE] Second one is perfect, thanks Lenny.
Sorry, you need to Log In to post a reply to this thread.