How A script that receives messages and teleports TeleportData with player to another game

Hello Developer, I recently created a script where you can assemble armor in the so-called lobby game, then teleport and wear it in the main game (in the lobby game you can buy armor and assemble it yourself)
I only have one problem and that is: when the player clicks on certain text buttons, certain parts are added to their armor, with each click on a text button a message is sent (for example, if the player clicks on breastplate armor, the message

plr.CurrentMorph.Value = "breastplatearmor"

is sent. The armor is something like morph characters, hence: plr.CurrentMorph.Value
). I don’t know how to create a script that receives all these messages and teleports them to another game with the player when they click on an image button (the script can only send the received messages to the other game when the player clicks on a text button. An example:

(this is not supposed to be a script, it is just supposed to show what the script should do)

receives all messages.
(for example:
breastplate armor,
helmet,
gilded wings,
)
when player clicks on text button
=send TeleportData: (for example:
breastplate armor,
helmet,
gilded wings,) to another game

then teleport player to another game

can someone explain to me how such a script is structured and how I should write it?)

The server can store the armor data via a table, and then set it to the TeleportData, once the player teleports use GetLocalPlayerTeleportData and LocalPlayerArrivedFromTeleport on the client. You can also make a datastore to secure the data on the server.

1 Like