Trading System adds a complete two-player exchange flow to an existing Roblox inventory. Players can request a nearby player or choose from a player list, accept or decline invitations, offer items and optional currency, review both sides, become ready, wait through a safety countdown (three seconds by default, configurable), and confirm the final trade.
Install the model in ReplicatedStorage, move the included server and client bootstrap scripts to the locations documented in the README, connect the InventoryAdapter to the game's existing item source, optionally connect CurrencyAdapter, and tune one Config module. A default in-memory adapter and a documented Pet System adapter example make integration clear.
The server owns every trade state, validates every remote argument, rate limits every action, locks offered items, checks ownership again at commit, and compensates completed transaction steps if any later step fails. Offer changes reset both players' Ready and Confirm state. Leaving, cancelling, rejection, insufficient ownership, or adapter errors close safely without leaving item locks behind.
Included
- Server-authoritative two-player trade state machine
- Adapter-based inventory and optional currency integration
- In-memory default adapters and Pet System example
- Atomic commit with ownership re-check and compensating rollback
- Item locks, blocklist, cooldowns, limits, and per-action rate limits
- Proximity and player-list requests
- Responsive phone, mouse, keyboard, and gamepad UI
- Ready, countdown, confirm, cancel, and disconnect flows
- Typed TradeCompleted server signal
- Lune pure-logic test suite
- Detailed setup, adapter contract, and security documentation
