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.
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 shopitemName(string): The item identifierquantity(number): The new stock quantity
Returns:
boolean:trueif successful,falseif shop/item not found
Example:
AddItemStock
Add stock to a specific item (increases current stock).
Parameters:
shopName(string): The name of the shopitemName(string): The item identifierquantity(number): Amount to add
Returns:
boolean:trueif successful,falseif shop/item not found
Example:
RemoveItemStock
Remove stock from a specific item (decreases current stock).
Parameters:
shopName(string): The name of the shopitemName(string): The item identifierquantity(number): Amount to remove
Returns:
boolean:trueif successful,falseif 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:trueif successful,falseif shop not found in config
Example:
Last updated