Here’s the snippet of code I’m using to teleport a player with data:
local data = Instance.new("TeleportOptions")
data:SetTeleportData({
LeagueServer = 2,
PublicServer = nil,
Id = id
})
tp:TeleportToPrivateServer(12671124579, id, {creator}, "void", data, loading:Clone())
(creator
is the player, id
is the private server id, and loading
is a ScreenGui).
The teleporting itself works fine, but every attempt of mine to receive the TeleportData within the new place returns nil
for some reason:
-- LocalScript
local ts = game:GetService("TeleportService")
local tpdata = ts:GetLocalPlayerTeleportData()
print(tpdata) -- nil
-- Script
game:GetService("Players").PlayerAdded:Connect(function(player)
print(player:GetJoinData().TeleportData) -- nil
end)
I’m stuck, since I’ve tried every way to send the data that I could find online (including sending it as a dictionary instead of a TeleportOptions instance), and nothing seems to work for me. Any help would be greatly appreciated.