Although the data should be the same when teleporting across universes (cause it tells me if they joined by website or from a different place game), data is registered as nonexistant.
Data being assigned:
local TeleportService = game:GetService("TeleportService")
local Options = Instance.new("TeleportOptions")
local Data = {
IsGoingToMain = false;
}
if ID == 8443566372 then --They are going to the main game
Data.IsGoingToMain = true
else
Data.IsGoingToMain = false
end
Options:SetTeleportData(Data)
local success, fail = pcall(function()
return TeleportService:Teleport(tonumber(ID),player,Options)
--TeleportAsync(tonumber(ID),{player},Options)
end)
Data being scanned:
if Data then --they did teleport, they have data
print("User has data")
if Data.IsGoingToMain == true then --They're joining the main game; place near the realms
local char = game.Players.LocalPlayer.Character
if char then
char.HumanoidRootPart.Position = game.Workspace.RealmSpawn.Position
end
end
end