Module 0 · In your browser · challenge 3 of 3 in this lesson

grantPack grants 50 coins only the first time a purchaseId arrives

A code cell with the real Luau runner grades it. No Studio needed.

Open

Level 3, Professional

Challenge

Combine the two economy rules from this lesson in plain Luau: guard a developer-product receipt so retries never double-pay, and compute a DevEx payout with the 30,000 minimum. Assume the entire balance earns the standard rate and the creator meets the other DevEx conditions. (The Studio project-file challenge waits until Set up your machine, part 3: connect, play, and the optional extras, once Rojo is installed.)

Start from
The code cell below, right in your browser (no Studio needed)
Check it here
Run the code cell; the challenge completes when it passes. No Studio needed.

Done means

  • grantPack grants 50 coins only the first time a purchaseId arrives
  • A repeated purchaseId returns 'PurchaseGranted' without adding coins a second time
  • For a standard-rate balance, devExUsd returns 0 below 30,000 Earned Robux and earnedRobux * 0.0038 at or above 30,000
Luau
Ctrl Enter runs the cell. Checked by tests