RX Scripts Logo
Housing

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

GetProperty

Retrieves property data by its ID.

local property = exports['RxHousing']:GetProperty(propertyId)
propertyId
number required

The unique identifier of the property.

GetAllProperties

Returns all properties in the system.

local properties = exports['RxHousing']:GetAllProperties()

GetOwnedProperties

Gets all properties owned by a specific identifier.

local ownedProperties = exports['RxHousing']:GetOwnedProperties(identifier)
identifier
string required

The player's identifier.

GetPropertyByLabel

Finds a property by its label/name.

local property = exports['RxHousing']:GetPropertyByLabel(label)
label
string required

The property's label.

AddKeyholder

Adds a keyholder to a property.

local success = exports['RxHousing']:AddKeyholder(propertyId, identifier)
propertyId
number required

The property ID.

identifier
string required

The identifier of the player to add as keyholder.

RemoveKeyholder

Removes a keyholder from a property.

local success = exports['RxHousing']:RemoveKeyholder(propertyId, identifier)
propertyId
number required

The property ID.

identifier
string required

The identifier of the keyholder to remove.

HasKey

Checks if a player has access to a property.

local hasAccess = exports['RxHousing']:HasKey(propertyId, identifier)
propertyId
number required

The property ID.

identifier
string required

The player's identifier.

TransferProperty

Transfers property ownership to another player.

local success = exports['RxHousing']:TransferProperty(propertyId, newOwner)
propertyId
number required

The property ID.

newOwner
string required

The identifier of the new owner.

SetPropertyPrice

Updates the price of a property.

local success = exports['RxHousing']:SetPropertyPrice(propertyId, newPrice)
propertyId
number required

The property ID.

newPrice
number required

The new price for the property.

DeleteProperty

Deletes a property from the system.

local success = exports['RxHousing']:DeleteProperty(propertyId)
propertyId
number required

The property ID to delete.

GetPropertyKeyholders

Gets all keyholders for a property.

local keyholders = exports['RxHousing']:GetPropertyKeyholders(propertyId)
propertyId
number required

The property ID.

GetPropertyFurniture

Gets all furniture in a property.

local furniture = exports['RxHousing']:GetPropertyFurniture(propertyId)
propertyId
number required

The property ID.

SetPropertyForSale

Sets a property for sale or removes it from sale.

local success = exports['RxHousing']:SetPropertyForSale(propertyId, forSale, price)
propertyId
number required

The property ID.

forSale
boolean required

Whether the property should be for sale.

price
number

Optional new price when setting for sale.

GetPlayersInProperty

Gets all players currently inside a property.

local players = exports['RxHousing']:GetPlayersInProperty(propertyId)
propertyId
number required

The property ID.

ForcePlayerExit

Forces a player to exit their current property.

local success = exports['RxHousing']:ForcePlayerExit(source)
source
number required

The player's server ID.

Client Exports

OpenPropertyDoorMenu

Opens the property door menu for a specific property. Useful for custom door lock systems.

local success = exports['RxHousing']:OpenPropertyDoorMenu(propertyId)
propertyId
number required

The property ID to open the door menu for.

OpenFurnitureMenu

Opens the furniture menu for the player.

local success = exports['RxHousing']:OpenFurnitureMenu(propertyId)
propertyId
number

Optional property ID, if not given it will open for the current property the player is in/at.