RX Scripts Logo
Recyclers

Exports

All client- & serversided exports included within this script. Exports provide callable functions that allow other resources to interact with this script's functionality.
If additional exports are required for your implementation, please submit a formal request through our ticketing system on the official Discord server.

Server Exports

ToggleRecycler

Toggles a recycler on or off by its ID.

local active = exports['RxZ_Recyclers']:ToggleRecycler(recyclerId, state, src)
recyclerId
string required

The unique ID of the recycler to toggle.

state
boolean

Optional: true to turn on, false to turn off, nil to toggle current state.

src
number

Optional: Player server ID for logging purposes. If not provided, logs will show "System".


ToggleClosestRecycler

Toggles the closest recycler to a player within a specified distance.

local active = exports['RxZ_Recyclers']:ToggleClosestRecycler(src, maxDistance, state)
src
number required

Player server ID to search around.

maxDistance
number required

Maximum distance in units to search for recyclers.

state
boolean

Optional: true to turn on, false to turn off, nil to toggle current state.

Client Exports

OpenRecycler

Opens a recycler.

exports['RxZ_Recyclers']:OpenRecycler(name, key, coords)
name
string required

Name of the recycler to open. This should match the name defined in the Config.Recyclers table.

key
string | number required

Key of the recycler: can be any string or number value as long as it is unique.

coords
vector3

Coords for saving it server-sided, so coords will be given within certain events triggered.