codeExports

Exported functions for managing business data including XP, levels, money, stock, and warnings. All functions include parameter validation and error handling.

Server-Side

All exports are server-side only and must be used in server-side scripts.


chevron-rightGet Business Levelhashtag

Description: Retrieves the current level and XP of a business. Returns a table containing level (number) and xp (number) values.

Parameters:

  • businessKey (string): The unique identifier of the business

Usage:

local data = exports['R6-MoneyWash']:GetBusinessLevel(businessKey)
print('Level:', data.level, 'XP:', data.xp)
chevron-rightAdd Business XPhashtag

Description: Adds experience points to a business. This will automatically trigger the leveling system when enough XP is accumulated.

Parameters:

  • businessKey (string): The unique identifier of the business

  • amount (number): The amount of XP to add (must be positive)

Usage:

exports['R6-MoneyWash']:AddBusinessXP(businessKey, amount)
chevron-rightAdd Business Moneyhashtag

Description: Adds money to a business balance. Supports both dirty money and clean money types.

Parameters:

  • businessKey (string): The unique identifier of the business

  • type (string): The money type - 'dirty' or 'clean'

  • amount (number): The amount of money to add (must be positive)

Usage:

exports['R6-MoneyWash']:AddBusinessMoney(businessKey, type, amount)
chevron-rightRemove Business Moneyhashtag

Description: Removes money from a business balance safely. The balance will never go below zero.

Parameters:

  • businessKey (string): The unique identifier of the business

  • type (string): The money type - 'dirty' or 'clean'

  • amount (number): The amount of money to remove (must be positive)

Usage:

exports['R6-MoneyWash']:RemoveBusinessMoney(businessKey, type, amount)
chevron-rightAdd Business Stockshashtag

Description: Increases the current stock quantity of a business.

Parameters:

  • businessKey (string): The unique identifier of the business

  • amount (number): The quantity to add (must be positive)

Usage:

chevron-rightRemove Business Stockshashtag

Description: Decreases the current stock quantity of a business. The stock will never go below zero.

Parameters:

  • businessKey (string): The unique identifier of the business

  • amount (number): The quantity to remove (must be positive)

Usage:

chevron-rightAdd Business Warninghashtag

Description: Adds warnings to a business. If no amount is specified, it defaults to 1 warning.

Parameters:

  • businessKey (string): The unique identifier of the business

  • amount (number, optional): The number of warnings to add (defaults to 1)

Usage:

chevron-rightRemove Business Warninghashtag

Description: Removes warnings from a business. You can specify a number or use 'all' to remove all warnings at once.

Parameters:

  • businessKey (string): The unique identifier of the business

  • amount (number|string): The number of warnings to remove, or 'all' to remove all warnings

Usage:

Last updated