RX Scripts Logo
Dealerships

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

GetDealership

Returns a dealership by its ID.

exports['RxDealerships']:GetDealership(dealershipId)
dealershipId
number required

ID of the dealership.

GetAllDealerships

Returns all dealerships.

exports['RxDealerships']:GetAllDealerships()

GetDealershipByName

Returns a dealership by its name.

exports['RxDealerships']:GetDealershipByName(name)
name
string required

Name of the dealership.

GetVehicle

Returns a vehicle from the master vehicle list by model name.

exports['RxDealerships']:GetVehicle(model)
model
string required

Model name of the vehicle.

GetAllVehicles

Returns all vehicles in the master vehicle list.

exports['RxDealerships']:GetAllVehicles()

GetDealershipVehicles

Returns all catalog vehicles for a specific dealership.

exports['RxDealerships']:GetDealershipVehicles(dealershipId)
dealershipId
number required

ID of the dealership.

IsDealershipOpen

Returns whether a dealership is currently open. Server and Tebex dealerships always return true.

exports['RxDealerships']:IsDealershipOpen(dealershipId)
dealershipId
number required

ID of the dealership.

GetPlayerFinances

Returns all active finances for a player.

exports['RxDealerships']:GetPlayerFinances(identifier)
identifier
string required

Identifier of the player.

GetPlayerTransactions

Returns all transactions for a player, optionally filtered by dealership.

exports['RxDealerships']:GetPlayerTransactions(identifier, dealershipId)
identifier
string required

Identifier of the player.

dealershipId
number

Optional dealership ID to filter transactions by.

GiveVehicle

Gives a vehicle to a player by saving it directly to their garage with a unique plate.

exports['RxDealerships']:GiveVehicle(src, model, primaryColor, secondaryColor)
src
number required

Server ID of the player.

model
string required

Model name of the vehicle.

primaryColor
number

Primary color index. Defaults to 0.

secondaryColor
number

Secondary color index. Defaults to 0.

SetDealershipStatus

Sets the open/closed status of a dealership.

exports['RxDealerships']:SetDealershipStatus(dealershipId, isOpen)
dealershipId
number required

ID of the dealership.

isOpen
boolean required

Whether the dealership should be open or closed.

SetDealershipBalance

Sets the balance of a dealership.

exports['RxDealerships']:SetDealershipBalance(dealershipId, amount)
dealershipId
number required

ID of the dealership.

amount
number required

New balance amount.

TransferDealershipOwnership

Transfers ownership of a player-owned dealership to a new owner.

exports['RxDealerships']:TransferDealershipOwnership(dealershipId, newOwnerIdentifier)
dealershipId
number required

ID of the dealership. Must be a player-owned dealership.

newOwnerIdentifier
string required

Identifier of the new owner.

Client Exports

OpenDealership

Opens a dealership showroom for the player.

exports['RxDealerships']:OpenDealership(dealershipId)
dealershipId
number required

ID of the dealership to open.

OpenAdminPanel

Opens the admin panel on the player's client.

exports['RxDealerships']:OpenAdminPanel(page)
page
string

Optional page to open the admin panel to.

OpenManagementMenu

Opens the management menu for a player-owned dealership.

exports['RxDealerships']:OpenManagementMenu(dealershipId)
dealershipId
number required

ID of the dealership to manage.

StartTestDrive

Starts a test drive for a specific vehicle at a dealership.

exports['RxDealerships']:StartTestDrive(dealershipId, vehicleModel)
dealershipId
number required

ID of the dealership.

vehicleModel
string required

Model name of the vehicle to test drive.

EndTestDrive

Ends the currently active test drive.

exports['RxDealerships']:EndTestDrive()

GetDealerships

Returns all dealerships loaded on the client.

exports['RxDealerships']:GetDealerships()