How to make trade function between players

I asked about basic player-to-player data sharing yesterday. The continuation of that.
I want to create a trading function. I know how to do it, but I don’t know the script. I would be happy if you could tell me.
example:
Put StringValue in player.Player1.Pets. Value is the pet’s name.
Let’s say Player2 also has this.
When the trade between players is over, the string value of the selected pet will be exchanged between players.

2 Likes

I was making a trade system and I was stuck with how to do this. But I realized that I just need something to hold the data of both players together, and I came across of using a processor (which is basically just a folder that hold the data of 2 traders). The structure of the processor is:

Player1-Player2 -- this would be the processor's name
    Player1 -- this folder inside the processor will hold player1's data (pets, stats etc)
    Player2 -- this is the same as above but for player2

Let’s say someone chose a pet, it will grabs the pet’s data, bring it to the server, use a folder as a container to keep the data (you can use attributes to keep the pet’s specific data such as ExpMultiplier, etc), and put it into the folder that match their name. Once your done trading, inside each client you can copy the processor on their own to initialize the data that they’ve traded.

3 Likes