You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I want to send data from the lobby to a reserved server.
- What is the issue? Include screenshots / videos if possible!
teleport data always prints nil
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have also tried the client receiving method which is GetLocalPlayerTeleportData()
this also does not work and prints nil.
I have used messaging service Publish & Subscribe async which works but only when there is a player on the reserved server and the server sending the message is still alive. This is not reliable.
Place1 (lobby, sends data)
local teleportOptions = Instance.new("TeleportOptions")
teleportOptions:SetTeleportData(serverSettings)
local success, err = pcall(function()
TS:TeleportToPrivateServer(placeID, serverCode, plrQueue, nil, teleportOptions)
end)
if not success then
print("Teleport failed: " .. err)
end
Place2 code (recieves data)
PS.PlayerAdded:Connect(function(plr)
local joinData = plr:GetJoinData()
local tpData = joinData.TeleportData
print(tpData) -- always nil );
end)