So TeleportService:GetLocalPlayerTeleportData() is used to transfer data from a start place into another place, however this data is only to be used by the client. Is there a way to send data from the start place to a second place for that second place’s scripts to work with. An example would be difficulty.
A player starts a dungeon raid, and chooses the “Easy” difficulty and begins the teleport process to the dungeon. The dungeon place then retrieves the data which includes the difficulty of “Easy”. I feel like right now that the best way to do this is have multiple dungeon places that only differ in difficulty. Meaning that the chances of one of these places and not noticing it will be very high.
Isnt this for individual player data though? For example, i need to send server data.
Player sets the raid difficulty to “Easy”. Then this data is transferred to the teleporting place. This is my code so far, this screenshots are server scripts:
When the player clicks the box to teleport. Note the teleportData holds the data i wish to send to the new place:
In the new place, I wish for the server to then retrieve this data, local Difficulty should equal “Easy”, however, this data is for the client to retrieve which I do not want.
Non-problem. TeleportToPrivateServer sets the teleport data the same for all players. Yes, the method is for individual players, but they all have the same data because of your call.
Teleport data is transmitted with the client. The only other option you have as of right now is to use DataStores which may not be a very lovely idea. There’s Ephemeral DataStores as well but those aren’t yet guaranteed and are just a future prospect.
That is a terribly ugly way to do it and I do not recommend doing that at all. Use teleport data or DataStores. Don’t trouble yourself in making tons of new places just for difficulty in place of using some arbitrary value to determine that.
Actually what I am thinking is, since the current method of TeleportService:GetLocalPlayerTeleportData() is for the client to then deal with, I could possibly make it so that the client fires to the server what the chosen difficulty is, and then the server chooses what the majority difficulty. Of course, if there are no hackers to quickly send to the server a false difficulty, then the difficulty would be the same for all players, therefore the expected difficulty will be chosen.