Lesson 11 of 11
Capstone, part 2: cosmetic pass trail, localization and thumb targets
Part 2 of the Beacon Yard capstone crosses monetization, VFX, localization and React UI: add a cosmetic pass trail and localized shop entry in Studio, then fix the 44px Close button in ShopApp.luau.
By the end you can
- Build a server-owned cosmetic pass trail in PassService that never changes WalkSpeed, and wire its localized label into ShopLabels and Strings.csv
- Fix a real 44-pixel touch-target bug in m14-ship's React shop (ShopApp.luau) while keeping all three Controls.luau wrench bindings intact
- Prove both changes with the Studio playtest (capstone_cosmetic_trail) and the browser-graded mobile rule check
Before this: Capstone, part 1: brief, rules and two yard extensions, UI frameworks, part 1: React-lua, elements, props and state, Localization: reaching other languages
Step 1 of 6
Why SpeedPass and a cosmetic trail follow different design rules
A game pass is bought once and owned for good, so there is no receipt to process1. The server asks MarketplaceService whether the player owns it and stores the result as a server-written player attribute.
-- A game pass is bought once and owned for good, so there is no receipt
-- to process. The server asks MarketplaceService whether the player owns
-- the pass, and writes the answer to the SpeedPass player attribute.
-- DataService.applySpeed reads that attribute and adds
-- Config.PASS_SPEED_BONUS. A client cannot set a server attribute, so a
-- client cannot give itself the pass.
Notice the design difference. Beacon Yard's SpeedPass adds Config.PASS_SPEED_BONUS (+4 walk speed) because Beacon Yard is a cooperative PvE drill where faster teammates help everyone survive. A cosmetic pass such as a spark trail must never alter WalkSpeed, health, or damage, because selling stats in competitive games breaks fairness.
Server sideRemember: The server is the referee with the only real scoreboard.
A LocalScript fires a remote claiming TrailPass = true. What should the server do?
Press 1 to 4 to choose, Enter to check.
Step 2 of 6
Keeping ShopLabels and Strings.csv in sync
At m14-ship, every visible word in the React shop starts in ShopLabels.luau's SOURCE table and has a matching row in src/locale/Strings.csv (which Rojo maps to LocalizationService.BeaconStrings)2. Adding a new shop item without adding its translation row leaves French and Spanish players seeing untranslated English or raw keys.
local SOURCE: { [string]: string } = {
["shop.title"] = "Quartermaster",
["shop.close"] = "Close",
["shop.speed"] = "Speed",
["shop.speed.detail"] = "faster for good",
["shop.shield"] = "Shield",
["shop.shield.detail"] = "blocks one drone hit",
["shop.price"] = "{n} coins",
["shop.item.short"] = "{price}, need {short} more",
["shop.item.ok"] = "{price}, {detail}",
["shop.wallet"] = "You have {n} coins",
["shop.pack"] = "Coin Pack",
["shop.pack.ready"] = "{n} coins",
["shop.pass"] = "Speed Pass",
["shop.pass.owned"] = "owned",
["shop.pass.sale"] = "+{bonus} speed for good, Robux",
Where does it break?“The referee with the only real scoreboard” is a good picture of the server. Where does it stop being true?
It breaks here. The server is also the field itself, and it cannot see things that exist only on a client, such as a player's GUI or a LocalScript's effects.
The true model. The server runs the authoritative copy of the whole game world. Anything that matters (coins, damage, purchases) is decided there, and clients only see what it replicates to them.
The server owns the TrailPass attribute and the Trail on the character, while each client's Translator renders the label in that player's language.
A LocalScript changes the trail button's label on one player's screen. Does PassService see that label change or treat it as a pass purchase?
Press 1 to 2 to choose, Enter to check.
If you add shop.trail to ShopLabels.luau but forget to add a matching row to src/locale/Strings.csv, what happens when a French player opens the shop?
Press 1 to 4 to choose, Enter to check.
Step 3 of 6
Build and grade Project 3 in Studio
Extend your m14-ship game in three files:
- In
src/server/PassService.luau, addPassService.hasTrail(player: Player): boolean(readsplayer:GetAttribute("TrailPass") == true) andPassService.setTrail(player: Player, owned: boolean). Write the"TrailPass"attribute, create twoAttachmentinstances on the character'sHumanoidRootPart(Vector3.new(0, 1, 0)andVector3.new(0, -1, 0)), attach aTrailnamed"PassTrail"between them, toggletrail.Enabled = owned, and leaveWalkSpeeduntouched. Also re-apply the trail onplayer.CharacterAddedifPassService.hasTrail(player)is true. - In
src/shared/ShopLabels.luau, add["shop.trail"] = "Spark Trail"toSOURCE. - In
src/locale/Strings.csv, add ashop.trailrow withen,frandestranslations. - Press Play and run
game.ServerScriptService.RunGameTests:Invoke("capstone_cosmetic_trail", "capstone-cosmetic-trail")in the server command bar.
Level 3, Professional
Challenge
Extend PassService.luau, ShopLabels.luau and Strings.csv in your m14-ship game, then run challenges/capstone_cosmetic_trail.luau in Studio. Solution: challenges/solutions/capstone-trail-ui.md.
- Start from
- The game at milestone m14 (download)
- Grade it
- In Studio, press Play, then run
game.ServerScriptService.RunGameTests:Invoke("capstone_cosmetic_trail", "capstone-cosmetic-trail")in the server command bar. Copy the pass code from Output.
Done means
- PassService.setTrail(player, true) sets the TrailPass attribute to true and attaches an enabled Trail named PassTrail with both attachments
- Calling DataService.applySpeed(player) with TrailPass enabled leaves Humanoid.WalkSpeed identical to before
- PassService.setTrail(player, false) sets TrailPass to false and disables or removes PassTrail
- ShopLabels.source()['shop.trail'] is non-empty and LocalizationService.BeaconStrings has a shop.trail row with en, fr and es entries
- challenges/capstone_cosmetic_trail.luau prints TEST PASS for all five checks
A player owns TrailPass, dies during a drill, and respawns with a brand-new Character model. Why does PassService need a CharacterAdded listener?
Press 1 to 4 to choose, Enter to check.
Step 4 of 6
Project 4: spot the 44px touch bug in m14-ship's React shop
Touch targets on phones need at least 48 by 48 pixels so a thumb does not miss or hit the wrong row3. Now inspect src/client/ShopApp.luau at m14-ship: each ShopButton is 84 pixels tall, but look at the Close button at the bottom of the panel.
Close = e("TextButton", {
Size = UDim2.new(1, 0, 0, 44),
Close is 44 pixels tall: four pixels below the 48-pixel rule. Meanwhile, src/client/Controls.luau binds the wrench across keyboard (F), gamepad (ButtonR2) and a touch button (touchButton = true). Any UI or input tweak must preserve all three devices.
WrenchSwing = {
title = "Swing",
inputs = { Enum.KeyCode.F, Enum.KeyCode.ButtonR2 },
touchButton = true,
Other ways pros do this
| Option | What it is | When pros pick it | Trade-offs |
|---|---|---|---|
| React-lua (m09-react-shop onward) | Declarative components and hooks installed through Wally; state changes re-render only the changed Instances. | Complex menus, shops, inventories and multi-state HUDs like Beacon Yard's ShopApp. | Extra package dependency and a mental shift from imperative Instance.new code. |
| Fusion or Vide | Reactive state-graph UI libraries popular in Roblox studios. | Teams that prefer fine-grained reactive values over React's render tree and hooks. | Smaller ecosystem than React-lua and fewer cross-platform React developers. |
| Plain Instances (m07-feel ShopGui) | Direct Instance.new and property mutations in Luau. | Tiny one-off prompts or learning how ScreenGui and layouts work. | State updates scatter across callbacks and become bug-prone as screens grow. |
In m14-ship's ShopApp.luau, how many pixels too short is the 44px Close button compared to the 48px touch-target minimum?
Which three input devices does Controls.luau bind under the single action name WrenchSwing at m14-ship?
Press 1 to 4 to choose, Enter to check.
Step 5 of 6
Fix the rule cell and ShopApp.luau
Fix thumbOk and wrenchBindings in the browser cell below to grade Project 4. To grade in Studio instead, copy your rules into challenges/work/capstone_mobile.luau, press Play and run game.ServerScriptService.RunGameTests:Invoke("capstone_mobile", "capstone-mobile") in the server command bar. Then raise Close's height from 44 to 48 and the panel's Size from 636 to 640 in your own src/client/ShopApp.luau. Neither grader opens ShopApp.luau. They only test the two helper rules, so a pass code does not prove the shop changed. You check the shop yourself: press Play, open the shop on a phone-sized emulator and confirm every button is at least 48 pixels tall and nothing clips.
Level 2, Builder
Challenge
Pass the code cell above (or challenges/capstone_mobile.luau in Studio), then update Close in src/client/ShopApp.luau and check it by eye. The pass code covers the first two criteria only. Solution: challenges/solutions/capstone-trail-ui.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_mobile", "capstone-mobile")in the server command bar. Copy the pass code from Output.
Done means
- thumbOk returns true only when both width and height are at least 48
- wrenchBindings returns Touch, F and ButtonR2
- Manual check, not covered by the pass code: in your own src/client/ShopApp.luau, Close has height 48 and the panel height is 640 so nothing clips
Have a Studio pass code?
After raising Close's height from 44 to 48 inside ShopApp.luau, why do we also raise the parent Frame's height from 636 to 640?
Press 1 to 4 to choose, Enter to check.
Step 6 of 6
Recap
Recap
- Project 3 adds a server-owned TrailPass attribute and cosmetic PassTrail in PassService without altering WalkSpeed, plus en/fr/es entries for shop.trail in ShopLabels and Strings.csv.
- Project 4 catches and fixes a real 44px Close button in m14-ship's ShopApp.luau and verifies the 48px touch rule and three-device wrench bindings.
The server is the referee with the only real scoreboard, until the server is also the field itself, and it cannot see things that exist only on a client, such as a player's GUI or a LocalScript's effects.
Queued for review
- A LocalScript fires a remote claiming TrailPass = true. What should the server do?
- If you add shop.trail to ShopLabels.luau but forget to add a matching row to src/locale/Strings.csv, what happens when a French player opens the shop?
- A player owns TrailPass, dies during a drill, and respawns with a brand-new Character model. Why does PassService need a CharacterAdded listener?
- In m14-ship's ShopApp.luau, how many pixels too short is the 44px Close button compared to the 48px touch-target minimum?
Next Capstone, part 3: multi-product receipts and party matchmaking