Hello fellow developers, I have an issue with the player:GetJoinData() when I use the TeleportService. The following information is what I am trying to pass through;
local teleportDataRed = {
team = "Red",
partnerUserId = BlueTeammate.UserId,
partnerTeam = "Blue",
OwnColor = Color3.fromRGB(255, 0, 0)
}
local teleportDataBlue = {
team = "Blue",
partnerUserId = RedTeammate.UserId,
partnerTeam = "Red",
OwnColor = Color3.fromRGB(0, 47, 255)
}
TeleportService:Teleport(destination, RedTeammate, teleportDataRed)
TeleportService:Teleport(destination, BlueTeammate, teleportDataBlue)
How I am trying to get the data;
--{{ Service's }}--
local Players = game:GetService("Players")
--{{ Variables }}--
local player = Players.LocalPlayer
local joinData = player:GetJoinData()
local teleportData = joinData and joinData.TeleportData
if teleportData then
print("Teleport data received:")
for key, value in pairs(teleportData) do
print(key, value)
end
local team = teleportData.team
local partnerId = teleportData.partnerUserId
local partnerTeam = teleportData.partnerTeam
local ownColor = teleportData.OwnColor
else
warn("No TeleportData received?")
end
It has been annoying me for a while.