Shelf = id = "A1", product = "Milk", maxCapacity = 12, currentStock = 5, restockPrice = 4.50, shelfPosition = Vector3.new(10, 2, 15)
| Function Name | Parameters | Description | |---|---|---| | StartTransaction(customer) | Customer object | Opens the checkout UI, scans items one by one. | | ScanItem(item) | Item ID, price | Adds item to current bill, updates total. | | CalculateTotal() | None | Returns total price + tax. | | ProcessPayment(paymentMethod) | "cash" or "card" | Checks if customer has enough money; handles change. | | BagItems() | None | Animates bagging, removes items from counter. | | CompleteTransaction() | None | Gives receipt, spawns next customer in line. | supermarket simulator script
function Cashier:CompleteTransaction() -- Spawn next in queue self.currentCustomer = nil self.totalBill = 0 end Shelf = id = "A1", product = "Milk",
| 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. | | | ProcessPayment(paymentMethod) | "cash" or "card" |
| UI Element | Data Source | Update Frequency | |---|---|---| | Current Money | Module D | Real-time | | Daily Customers | Module C | Per spawn/leave | | Stock Alerts | Module B | When shelf < 20% | | Customer Thoughts | Module C | Floating text above head | | Day / Time | System clock | Every 60 sec |