Module 11 · In your browser · challenge 1 of 2 in this lesson
Build and grade the multi-product receipt router
A code cell with the real Luau runner grades it. No Studio needed.
Open
Level 3, Professional
Challenge
Pass the browser cell above (and optionally challenges/capstone_catalog.luau in Studio). Solution: challenges/solutions/capstone-systems.md.
- Start from
- The game at milestone m14 (download)
- Check it here
- Run the code cell; the challenge completes when it passes. No Studio needed.
- Or grade it in Studio
- In Studio, press Play, then run
game.ServerScriptService.RunGameTests:Invoke("capstone_catalog", "capstone-catalog")in the server command bar. Copy the pass code from Output.
Done means
- Product id 0 or any id missing from catalog returns (balance, NotProcessedYet, nil) without touching seen
- A first valid purchase with saveOk == true and recordOk == true grants entry.coins, marks seen[purchaseId], and returns PurchaseGranted with entry.sku
- A replay of the same purchaseId adds 0 coins and returns PurchaseGranted with nil SKU
- When saveOk == false or recordOk == false, balance and seen stay unchanged and NotProcessedYet is returned so a later retry pays cleanly