shadowyRoblox developer
All work

Trading system

Send a request, put items in an offer, and both players have to accept and then confirm before anything moves.

Overview

You walk up to another player, send a trade request, and they get a popup with accept and cancel on it. Nothing opens on your screen until they take it.

Once it is open your items are down the left, theirs are down the right, and there is an offer box for each of you in the middle. Click an item to put it in, click it again to take it back. Their side updates on your screen while they do the same thing.

Then both of you accept, and after that both of you confirm. The confirm box counts how many players have confirmed, so you can see whether it is waiting on you or on them.

Trading is the one system where a bug costs somebody their stuff, so most of the time went into the states behind it rather than the window.

What I built

01

The request

A request puts a popup on the other player with accept and cancel. If they cancel, nothing happened. If they accept, the window opens for both of you at the same time.

02

The UI

Every bit of interface in the clip is mine. The request popup, the trade window, the item slots and their info cards, the accept and confirm boxes, the trade complete banner. Built and scripted, not dropped in from a kit.

03

The trade window

Your inventory on the left, theirs on the right, two offer boxes in the middle. Items move between your list and your offer on a click, and anything they add or take back shows up on your side straight away.

04

Item info

Every item in the window has an info button that opens its card. Level, speed, luck, pick up range. You can read what you are being handed without closing the trade to go look it up.

05

Accept, then confirm

Accepting puts an accepted tag on your side of the window so the other player can see it. When both sides are in you get the are you sure box, and it counts confirms up to two of two. Nothing moves before that.

06

The swap

The server does the actual move. It checks both players still own what they offered, then moves everything in one go, so there is no state where one side has paid and the other has not.

Problems I hit

Problem

You could change your offer after the other player had already accepted. Put a good item in, wait for the accept, take it back out.

How I solved it

Touching an offer clears both accepts. It is slightly annoying in a normal trade and it is the only thing that makes the accept worth anything.

Problem

If somebody left in the middle of a trade, the window just sat there on the other screen.

How I solved it

The trade closes and hands everything back if either player leaves. Items stay with their owner until the swap runs, so there is nothing sitting in limbo to recover.

Problem

Nobody could tell whether a trade was waiting on them or on the other person, so people just kept clicking confirm.

How I solved it

Put the count on the box and the accepted tag over their side. Two of two, and you can see which half of it is you.

More media