Entities Singleton
🧠 Entities Singleton
CLIENT for an object to be available in the entities list, it must be rendered.
SERVER always fully populated, allow to access or manipulate any object, no matter where it is in the world.
All live entity instances are tracked in the Entities singleton.
Each object is uniquely identified by its uNetId
</> API Reference
Entities:get(id)
Fetch a object instance from its uNetId
Entities:waitFor(id, timeout? = 5000)
Continuously try to fetch a object instance from its uNetId until found or timeout
Entities:getBy(key, value)
Find an instance by a custom field, value can also be a function working as a filter
Entities:getAllBy(key, value)
Returns a table containing all instances that respect the filter, value can also be a function working as a filter
Entities:createByName(name)
Instantiate a new object of a class with that name
Examples:
🔍 Debug & Tracking Tips
You can easily track which objects are active on the server via Entities.list.
Example: list all crates currently spawned:
Last updated