Help with getting join data

So I am using teleportAsync to teleport players and send teleportOptions, this is my code here:

function module.TeleportLobby(players:SharedTable,Info)

	local SendInfo = {
		ExtraInfo = Info,
		players = players,
		Rar = "Hello world"
	}
	
	-- || TP Options ||
	local options = Instance.new('TeleportOptions') 
	
	-- || Set Values ||
	options:SetTeleportData(SendInfo)	
	options.ShouldReserveServer = true
	
	print(options:GetTeleportData())
	
	teleportService:TeleportAsync(IDS.MainLobby,players,options)
end

So that sends you to a server, which works right. But when they arrive to the server, the joindata I get is this:
Screenshot 2024-08-24 134315
So like does roblox turn it into well some kinda coded thing that I can decode? Otherwise how do I get the JoinData? Heres how I get join data btw.

-- || Setup Player ||
function module.Functions.SetupPlayer(Player:Player) -- setup the player
	warn("Sent Data",Player:GetJoinData())
	
	-- values
	local char = Player.Character or Player.CharacterAdded:Wait()

	-- setup character
	if char then
		module.Functions.SetupChar(char)
	end

	Player.CharacterAdded:Connect(module.Functions.SetupChar)

end

its printing the tables memory address (not rlly important)

if you were to do warn("Sent Data",Player:GetJoinData().ExtraInfo) for example it should work

1 Like

Hmm well I did this

warn("Sent Data",Player:GetJoinData().Rar)

It warns nil, whys that?

1 Like

oh i forgot that :GetJoinData() returns a dictionary like this

try doing something like this

warn("Sent Data",Player:GetJoinData().TeleportData.Rar)
1 Like

Same thing, nil. Can teleportOptions only take certain types of data to use as TeleportData? Like just strings or something like that?

1 Like

I would try to use GetLocalPlayerTeleportData() it grabs the local players teleport data, and maybe you can send it back to the server and work with that.

Im not sure if it can work but give it a shot.

1 Like

Sadly I dont think getting it via the client is a good idea considering that I need this stuff for the server, so if they changed info in there it’d mess some stuff up, ofc I could do some checks and compare all data from clients but thats a whole lot of extra work.

1 Like

maybe try this?

local HttpService = game:GetService("HttpService")

function module.TeleportLobby(players:SharedTable,Info)

	local SendInfo = {
		ExtraInfo = Info,
		players = players,
		Rar = "Hello world"
	}
	
	-- || TP Options ||
	local options = Instance.new('TeleportOptions') 
	
	-- || Set Values ||
	options:SetTeleportData(HttpService:JSONEncode(SendInfo))	
	options.ShouldReserveServer = true
	
	print(HttpService:JSONDecode(options:GetTeleportData()))
	
	teleportService:TeleportAsync(IDS.MainLobby,players,options)
end

script that retrieves the data

local HttpService = game:GetService("HttpService")

-- || Setup Player ||
function module.Functions.SetupPlayer(Player:Player) -- setup the player
	warn("Sent Data",HttpService:JSONDecode(Player:GetJoinData()))
	
	-- values
	local char = Player.Character or Player.CharacterAdded:Wait()

	-- setup character
	if char then
		module.Functions.SetupChar(char)
	end

	Player.CharacterAdded:Connect(module.Functions.SetupChar)

end
1 Like

Sadly, this just gives me another one of the random numbers:

If I try doing .TeleportData.Rar its jut nil, and same with just .Rar.

try printing its teleport data

already did

It prints the data, so honestly no clue

what prints when you do that

the send data table that I got here:

so i found out the table: random numbers thingy is just a normal thing when playing on the client

but idk why .rar is nil

1 Like