Exports

Client

DisableShop

Disables a specific shop by its ID

Usage:

exports['envi-shops']:DisableShop(shopID, cooldownTime)
-- Disables the '24/7 - Strawberry' shop until it is enabled again
exports['envi-shops']:DisableShop('24/7 - Strawberry')
-- Disables the '24/7 - Strawbeery' shop for 300 seconds
exports['envi-shops']:DisableShop('24/7 - Strawberry', 300)

Parameters:

  • shopID (string): The ID of the shop to disable.

  • cooldownTime (number): The cooldown time in seconds before the shop is auto-enabled again.

EnableShop

Enables a specific shop by its ID.

Usage:

exports['envi-shops']:EnableShop(shopID)
-- Enables the '24/7 - Strawberry' shop, if it is disabled
exports['envi-shops']:EnableShop('24/7 - Strawberry')

Parameters:

  • shopID (string): The ID of the shop to enable.

DisableAllShops

Disables all shops in the config file

Usage:

exports['envi-shops']:DisableAllShops(cooldownTime)
-- Disables all shops for 600 seconds (10 minutes)
exports['envi-shops']:DisableAllShops(600)

Parameters:

  • cooldownTime (number): The cooldown time in seconds before the shops are auto-enabled again.

EnableAllShops

Enables all shops

Usage:

exports['envi-shops']:EnableAllShops()

Server

GetItemStock

Get the current stock quantity for a specific item in a shop.

Parameters:

  • shopName (string): The name of the shop (e.g., "24/7 Supermarket 1")

  • itemName (string): The item identifier (e.g., "water")

Returns:

  • number: Current stock quantity (returns 0 if not found)

Example:

SetItemStock

Set the stock quantity for a specific item in a shop to an exact value.

Parameters:

  • shopName (string): The name of the shop

  • itemName (string): The item identifier

  • quantity (number): The new stock quantity

Returns:

  • boolean: true if successful, false if shop/item not found

Example:

AddItemStock

Add stock to a specific item (increases current stock).

Parameters:

  • shopName (string): The name of the shop

  • itemName (string): The item identifier

  • quantity (number): Amount to add

Returns:

  • boolean: true if successful, false if shop/item not found

Example:

RemoveItemStock

Remove stock from a specific item (decreases current stock).

Parameters:

  • shopName (string): The name of the shop

  • itemName (string): The item identifier

  • quantity (number): Amount to remove

Returns:

  • boolean: true if successful, false if shop/item not found

Example:

GetShopStock

Get all stock for a specific shop.

Parameters:

  • shopName (string): The name of the shop

Returns:

  • table: Table of all items and their quantities (empty table if shop not found)

Example:

GetAllStock

Get the complete stock table for all shops.

Returns:

  • table: Complete stock table with all shops and items

Example:

ResetShopStock

Reset stock for a specific shop back to config values.

Parameters:

  • shopName (string): The name of the shop

Returns:

  • boolean: true if successful, false if shop not found in config

Example:

ResetAllStock

Reset all shop stock back to config values.

Returns:

  • boolean: Always returns true

Example:

Stock Exports Usage Examples

Example 1: Restocking Script

Example 2: Admin Command

Example 3: Low Stock Print


Shop Names

To use these exports, you need the exact shop names from your config. Default examples:

  • "24/7 Supermarket 1"

  • "24/7 Supermarket 2"

  • "Liquor Store 1"

  • "Liquor Store 2"

Last updated