I have a game where I matchmake people into a reserved server. However seeing as I can’t retrieve JoinData.Members, I have been trying to use TeleportData to send a table of information regarding how many people are in their party.
The TeleportData I set on the server of the start place:
local players = game.Players:GetChildren()
local tele_data = {
Party = players,
}
When I call:
print(#tele_data.Party)
--Output: 0
It sends over the table fine, but somewhere along they way everything inside disappears.
I’m new to using the TeleportService so any help is greatly appreciated, thanks in advance.
Sorry I should’ve added, the code I wrote on my post is a simplification of the actual code but holds true, I know for a fact at the time of sending the player off with the TeleportToPrivateServer method, that the #Party is 1 or more. (I’ve gone through with print statements and what-not.)
However upon retrieving the data with the GetJoinData method, It seems to drop all of the items in the array.
wait(5)
local players = game.Players:GetPlayers()
local tele_data = {
Party = players,
}
for _,player in pairs(tele_data.Party) do
print(player:GetJoinData().SourceGameId)
print(player:GetJoinData().SourcePlaceId)
print(player:GetJoinData().Members)
print(player:GetJoinData().TeleportData)
end
Did you add this code?
This prints nil, which is normal.
The reason is running it in Roblox studio.
The code where I set the tele_data is in the start place, and I send it as the TeleportData parameter in TeleportToPrivateServer, I use GetJoinData() in the place they are teleporting to, forgive me If I’m misinterpreting your post. I apologize if I didn’t make it clear enough in my previous posts.
And that is to say, upon joining the new place/private server, I use GetJoinData() to determine how many people were sent along with this player as to circumvent the use of JoinData.Members which can’t be used with TeleportToPrivateServer()