Purpose: Spawns, navigates, decides purchases, and reacts to prices.
if self.itemsScanned == #self.currentCustomer.shoppingList then self:ProcessPayment() end end
| Function Name | Parameters | Description | |---|---|---| | CheckShelfLevel(shelfID) | Shelf identifier | Returns % full (0.0 to 1.0). | | RestockShelf(shelfID, productType) | Shelf ID, product ID | Increases stock on shelf by 1 unit (or bulk). | | RemoveItemFromShelf(shelfID) | Shelf ID | Called when customer picks an item – reduces stock. | | GetStorageStock(productID) | Product ID | Returns how many boxes left in back room. | | OrderNewStock(productID, quantity) | Product ID, quantity | Deducts money, adds to storage after delivery delay. | supermarket simulator script
Shelf = id = "A1", product = "Milk", maxCapacity = 12, currentStock = 5, restockPrice = 4.50, shelfPosition = Vector3.new(10, 2, 15)
| Function Name | Parameters | Description | |---|---|---| | AddDailyIncome(amount) | Money earned | Updates bank balance. | | PayDailyExpenses() | None | Deducts rent, salaries, electricity. | | UpgradeCashierSpeed(cost) | Upgrade cost | Reduces scan time per item. | | UnlockNewProduct(productID, cost) | Product ID, cost | Adds new item to supplier list. | | ExpandStoreArea(areaID, cost) | Area ID, cost | Unlocks new shelves and floor space. | | GetDailyReport() | None | Shows profit/loss, customer count, top selling item. | Purpose: Spawns, navigates, decides purchases, and reacts to
| Upgrade | Level 1 | Level 2 | Level 3 | |---|---|---|---| | Scan Speed | 2.0 sec/item | 1.5 sec/item | 1.0 sec/item | | Customer Patience | 30 sec | 45 sec | 60 sec | | Shelf Capacity | 10 units | 15 units | 20 units | Module E: UI & Player Feedback Purpose: Displays information and handles player interaction.
function Cashier:ScanItem(item) self.totalBill = self.totalBill + item.price self.itemsScanned = self.itemsScanned + 1 game.ReplicatedStorage.Events.UpdateBill:FireAllClients(self.totalBill) | | RemoveItemFromShelf(shelfID) | Shelf ID | Called
| Function Name | Parameters | Description | |---|---|---| | SpawnCustomer() | None | Creates a new customer at entrance with random patience & budget. | | ChooseShoppingList(customer) | Customer object | Generates 3-6 random products from available store items. | | NavigateToProduct(productID) | Product ID | Moves character to shelf location (pathfinding). | | PickUpItem(productID) | Product ID | Animates grab, removes from shelf, adds to cart. | | ReactToEmptyShelf() | None | Reduces happiness, may leave store early. | | MoveToCheckout() | None | When shopping list complete → goes to shortest queue. |