it says “No TeleportData found for player” which mean the data isnt sending please help
place #2
game.Players.PlayerAdded:Connect(function(plr)
local joinData = plr:GetJoinData() -- Updated to use GetJoinData
if joinData and joinData.TeleportData then
local teleportData = joinData.TeleportData
local userid = teleportData.UserId
print("Teleport Data UserId:", userid)
else
print("No TeleportData found for player", plr.Name)
end
end)
place #1
local function teleportToServer(plr, serverCode)
local id = ServerNamesDS:GetAsync(serverCode)
local code = ServerAccessCodesDS:GetAsync(id)
if code then
local TeleportData = { UserId = plr.UserId }
local teleportOptions = Instance.new("TeleportOptions")
teleportOptions:SetTeleportData(TeleportData)
print("Teleporting with data:", TeleportData) -- Debug line
TS:TeleportToPrivateServer(122839632522178, code, {plr}, nil, teleportOptions)
else
print("Invalid or expired server code.")
end
end
Does it work if you use TeleportService:GetLocalPlayerTeleportData() from the client instead? The docs mention this function but not Player:GetJoinData(), though I think GetJoinData should work too.