rw_buckets Server API — Entity Functions
Server-side API for managing entity routing buckets.
exports.rw_buckets:setEntityBucket(entityId, key)
Associates an entity with a specified bucket.
exports.rw_buckets:setEntityBucket(entityId, 'mission_alpha')
- entityId:
number
— Unique identifier for the entity. - key:
string
— The bucket key to associate the entity with.
exports.rw_buckets:removeEntityFromBucket(entityId)
Removes an entity from their current bucket.
exports.rw_buckets:removeEntityFromBucket(entityId)
- entityId:
number
— Unique identifier for the entity.
exports.rw_buckets:getEntityBucketKey(entityId)
Retrieves the bucket key associated with an entity.
local bucket = exports.rw_buckets:getEntityBucketKey(entityId)
print(bucket)
- entityId:
number
— Unique identifier for the entity.
Returns: string
| nil
— The bucket key associated with the entity, or nil
if not assigned.