Buckets

The utility library includes a small set of routing bucket related functions.

Routing bucket functions are server side only.

Functions

Below is a list of all the available functions related to bucket which can be accessed through the utils object.

utils.buckets.set_player_bucket = set_player_bucket
utils.buckets.get_bucket_settings = get_bucket_settings
utils.buckets.get_player_bucket = get_player_bucket
utils.buckets.get_players_in_bucket = get_players_in_bucket
utils.buckets.reset_player_bucket = reset_player_bucket
utils.buckets.temp_bucket = temp_bucket

set_player_bucket

Can be used to set a player into a different routing bucket.

utils.buckets.set_player_bucket(source, {
    bucket_id = 1,
    enable_population = true,
    lockdown_mode = "strict",
    max_players = 30,
    spawn_coords = vector4(0.0, 0.0, 0.0, 0.0)
})

get_bucket_settings

Can be used to retrieve the settings for a specified bucket.

local bucket_id = 1
local settings = utils.buckets.get_bucket_settings(bucket_id)

get_player_bucket

Can be used to retrieve the bucket ID the player is in.

local bucket_id = utils.buckets.get_player_bucket(source)

get_players_in_bucket

Can be used to retrieve all players within a bucket.

local bucket_id = 1
local players_in_bucket = utils.buckets.get_players_in_bucket(bucket_id)

reset_player_bucket

Can be used to reset a players bucket back to default 0.

utils.buckets.reset_player_bucket(player_id)

temp_bucket

Can be used to place a player in a temporary bucket for a specified amount of time.

utils.buckets.temp_bucket(player_id, temporary_bucket_id, duration_in_seconds)

Last updated