Im trying to send data with teleport options so when im printing data in lobby - it gives a table (it works) but when im trying to print teleport data in main game (main game means place where players teleporting to).
lobby script:
local function teleportPlayers()
if #list > 0 then
script.Parent.Barrier.SurfaceGui.Frame.Status.Text = "TELEPORTING"
script.Parent.Barrier.SurfaceGui.Frame.Status.TextColor3 = Color3.new(1,0,0)
local playersToTeleport = {}
local teleportTime = 0
for i=1,#list do
if game.Players:findFirstChild(list[i]) then
table.insert(playersToTeleport,game.Players:findFirstChild(list[i]))
TransitionEvent:FireClient(game.Players:findFirstChild(list[i]))
else
table.remove(list,i)
end
end
local teleportOptions = Instance.new("TeleportOptions")
teleportOptions:SetTeleportData({#playersToTeleport})
local code = TS:ReserveServer(placeId)
teleporting = true
TS:TeleportToPrivateServer(placeId, code, playersToTeleport, teleportOptions)
repeat wait() until #list <= 0
script.Parent.Barrier.SurfaceGui.Frame.Status.Text = "READY"
script.Parent.Barrier.SurfaceGui.Frame.Status.TextColor3 = Color3.new(34/255,255/255,20/255)
teleporting = false
wait(3)
--MS:PublishAsync(game.JobId, playersToTeleport)
end
end
main game script:
plrs.PlayerAdded:Connect(function(plr)
local JOIN_DATA = plr:GetJoinData()
local TELEPORT_DATA = JOIN_DATA.TeleportData
print(TELEPORT_DATA)
end)