Find the Entity at a location

hello,

tl;dr: i am trying to use lua to get the entity’s of a mlo to make them visible/invisible.

I am working on a script where users can steal stuff from a store.
For that i want the items to dissapear as they are being stolen.
However since the entity pointers differ between users i wonder if there is a efficient way to find entities based on their model and location something like GetEntityAtLocation(location) or something, i been digging trough stuff but haven’t been able to find anything.

yes i know i can search for models in a radius but it seems umm… inefficient.

hopefully people can help me.

Models in a radius is the best you’re going to get, unless the interior has entity sets that you swap between

thank you, i guess i will go with that then

Okay, so _4iY is correct. In terms of FINDING existing entities, there’s not REALLY a good way to do so, however, entities have rooms and rooms have room ID’s. If your goal is to generate the entities yourself, then use your interior management system, you can leverage interior id’s / room id’s in order to dynamically render the entities based on player.

Not sure how efficient it can get but it’s worth a try.

Here’s a tool that uses and makes visually clear the concept of interiors and room ID’s called MLO Dev tool

And here’s an example of how you can get and use the interior ID’s and interior ROOM id’s can be found here

Hope these somewhat prove helpful, or at least give you an idea!