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:
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
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.
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.
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