A Shop UI and a Currency That Saves
By the end of this page you will have coins that players earn and keep between sessions, a shop button on screen, a shop screen with real items in it, and a purchase that still belongs to the player after they rejoin.
Time: 30 to 45 minutes.
Cost: about six messages. Build messages are charged by how much work each one takes rather than a flat rate, with a minimum of 0.1 credits per message — the credits pill in the dashboard header shows your balance as you go.
You need: Roblox Studio open on a place you can edit, and the Revix plugin connected — the pill at the top of the dashboard should show your game's name with a green dot. If it does not, start with Setup.
What you're building
Three pieces that have to agree with each other. A currency the server owns and saves. A shop screen the player opens, browses and buys from. And a link between them that a cheater cannot fake, because the server decides whether a purchase happens, not the player's computer.
Done looks like this: you press Play, collect a few coins, open the shop, buy a speed boost, watch your coin count drop, stop the game, press Play again — and you still own the boost.
Step 1 — Give players a currency the server owns
Add a Coins currency to my game. Put it on the leaderboard as a leaderstat called Coins, start every new player at 50, and save it with a DataStore so it comes back when they rejoin. Save on leave and also when the server shuts down, with retries. Keep all the tuning values like the starting amount in a config module rather than typed inline.What happens. The saving code lands in ServerScriptService, and any shared values go into ReplicatedStorage where both sides can read them. Revix writes saves with retry handling and a shutdown save as a matter of course — those are house rules, not something you have to ask for.
Check it worked. Press Play. The leaderboard in the top-right corner should read Coins 50.
Step 2 — Give players a way to earn coins
Put ten coin pickups around the spawn area: small spinning gold parts about 3 studs across, floating just above the ground. Touching one adds 5 coins on the server, plays a pickup sound, hides the coin and brings it back 20 seconds later. Make it impossible to farm the same coin twice while it is hidden.What happens. Both the parts and the touch handling get built together. Anything that grants currency is written server-side and rate-limited, so a player cannot spam the pickup.
Check it worked. Press Play and run over a coin. Coins should jump from 50 to 55, the coin should vanish, and it should be back roughly 20 seconds later. Run over the same spot while it is hidden — nothing should happen.
Step 3 — Build the shop screen
Build a shop screen for my game. A dark rounded panel in the middle, a title bar reading SHOP with a close button, and a scrolling grid of item cards. Each card shows the item name, a short line of description, a price in coins, and a Buy button. Fill it with three items for now: Speed Boost 100, Double Jump 250, Gold Trail 500. Use a clean modern look with one accent colour. Also add a coin counter pinned to the top right of the screen that updates live.What happens. A screen goes into StarterGui together with the script that drives it — Revix treats the wiring script as part of the build, because a screen with nothing behind it is a picture, not a UI. Every button gets a click handler, a hover effect and an entrance animation.
Two things worth knowing before you go looking for it. Screens that open on demand are built switched off, so they cannot flash on the player's screen the moment they spawn — you will not see the shop until you open it in a playtest. And Revix builds interfaces out of shapes, colour and text, not icon art. If you want an icon on a card, generate one first: see Generating Images.
Check it worked. Press Play. You should see the coin counter in the top right and no shop panel. That is correct so far — the button comes next.
Step 4 — Add the button that opens it
Add a SHOP button to the bottom of the screen that opens the shop panel, and make the close button and clicking the dark backdrop both close it. Animate it opening and closing rather than snapping. While the shop is open the coin counter should stay visible.What happens. The open, close and click-outside paths all get wired in one pass. Before finishing, Revix reads its own screen script back against the tree it just built, checking that every element it refers to actually exists and every button is connected to something.
Check it worked. Press Play, click SHOP. The panel should slide or fade in. Click the X, then reopen it and click the dark area outside the panel. Both should close it.
Step 5 — Make buying actually work
Make the Buy buttons work. When a player clicks Buy, the server checks they have enough coins, takes the price, records that they own the item, and sends back success or failure. The client must never decide whether a purchase happened. Show a short toast saying what they bought, or telling them they cannot afford it. Once an item is owned, its Buy button should read OWNED and stop working.What happens. The price check happens on the server. This is not optional politeness — anything a player's computer sends is treated as untrusted and re-checked, and anything that spends or grants gets rate-limited per player.
Check it worked. Press Play with 50 coins and click Buy on Speed Boost (100). You should be refused. Collect coins until you have 100 or more, buy it, and watch the counter drop by 100 while the button flips to OWNED.
Step 6 — Make the purchase survive a rejoin
Save which items each player owns alongside their coins in the same save, and apply the effects on join: Speed Boost sets walk speed higher, Double Jump lets them jump again in mid air, Gold Trail attaches a gold trail to the character. Re-apply everything when they respawn too. Then write and run a test that checks buying an item you cannot afford leaves coins and ownership untouched.What happens. Revix can write a Luau test, run it in your place and report back a pass or fail list per check, so the money logic gets proven rather than assumed. What it cannot prove from edit mode is anything that only exists for a live player, and it will say which parts those were.
Check it worked. Press Play, buy an item, stop, press Play again. The item should still be owned and its effect should already be on. Your coin total should be exactly where you left it.
Make it yours
Add tabs to the shop: Boosts, Cosmetics and Pets, with the item grid filtering when I click each tab.Add a sell-back button on owned items that refunds half the price.Make the coin counter pop and flash gold for half a second every time coins go up.Add a daily reward panel that gives 100 coins the first time a player joins each day, with a streak counter.Add a Robux gamepass for a permanent 2x coin multiplier and show it as a highlighted card at the top of the shop.If something goes wrong
The shop never appears when you click the button.
Clicking SHOP does nothing. Read the shop screen script against the actual screen tree, find where the button reference or the connection is wrong, and fix only that.Coins reset every time you rejoin.
Coins go back to 50 every time I rejoin in Studio. Tell me exactly what I need to switch on in Studio for saving to work, then read the output window and fix any errors you find.You can buy things with no money.
I bought a 500 coin item while holding 20 coins. Move the affordability check onto the server, ignore anything the client sends about price, and add a test that proves it.The panel is off screen or the wrong size.
The shop panel is half off the right side of the screen on a phone. Fix its anchoring and sizing so it stays centred on every screen size, and check nothing else is off screen.The build stopped before it finished. A card reading "That one stopped early" appears with a Keep going button. Press it, or type continue. Nothing already built is undone.