|
Информационный портал технической поддержки Центра проектирования интегральных микросхем |
Shelf = id = "A1", product = "Milk", maxCapacity = 12, currentStock = 5, restockPrice = 4.50, shelfPosition = Vector3.new(10, 2, 15)
function Cashier:ProcessPayment() if self.currentCustomer.money >= self.totalBill then self.currentCustomer.money = self.currentCustomer.money - self.totalBill game.ReplicatedStorage.Events.AddMoney:FireServer(self.totalBill) self:CompleteTransaction() else print("Customer cannot afford – leaving angry") self.currentCustomer.happiness = 0 self.currentCustomer:LeaveStore() end end supermarket simulator script
function Cashier:ScanItem(item) self.totalBill = self.totalBill + item.price self.itemsScanned = self.itemsScanned + 1 game.ReplicatedStorage.Events.UpdateBill:FireAllClients(self.totalBill) Shelf = id = "A1", product = "Milk",
| 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. | | | PickUpItem(productID) | Product ID | Animates
function Cashier:CompleteTransaction() -- Spawn next in queue self.currentCustomer = nil self.totalBill = 0 end
if self.itemsScanned == #self.currentCustomer.shoppingList then self:ProcessPayment() end end
| Сайт: | https://support.milandr.ru |
| E-mail: | support@milandr.ru |
| Телефон: | +7 495 221-13-55 |