Build a Player-to-Player Trade System
A trade lets two players hand items to each other in the world: you offer 5 bandages, they accept, the items move. The hard part is not the menu - it is making the swap impossible to cheat. This lesson builds a trade where the server owns every decision, both players must confirm, and a lock stops the classic "accept twice and duplicate the item" exploit.
The mental model: who is allowed to decide what
Before any code, get this picture straight, because it is the whole lesson.
In FiveM there are two worlds. The client is each player's own game - it runs on their PC, and a cheater can rewrite anything it sends. The server is the one machine you control. The rule that keeps every economy script safe is one sentence:
The client may ask. Only the server may decide and act.