Unable to recieve TeleportData from player

Hello! I am currently making a queue system and I have run into an issue with TeleportData that is supposedly “nil” when trying to receive that data from the instance the player is teleporting to.

I am trying to send the table of players that are being teleported so that once inside of the other place, it can wait for all players to load in. Unfortunately, when I attempt to get that data, it returns nil.

Code here:
Place1 Teleport Code:

local playersToTeleport = {} -- Table that will contain all playerobjects
for i, v in pairs(queue:GetChildren()) do -- Adding all alive players in queue to teleportList
	local plr = v.Value
	local char = plr.Character
	local hum = char.Humanoid
	if hum.Health > 0 then
		table.insert(playersToTeleport, plr)
	else
		v:Destroy()
	end
end
local tpOptions = Instance.new("TeleportOptions")
tpOptions.ShouldReserveServer = true
local teleportData = {
	TeleportedPlayers = playersToTeleport -- Setting playersToTeleport to table variable
} 
tpOptions:SetTeleportData(teleportData)
teleportModule(placeIdToTeleport, playersToTeleport, tpOptions) -- This teleports all players

Place2 Recieving Code:

local plr = plrs.PlayerAdded:Wait()
teleportedPlayers = plr:GetJoinData().TeleportData.TeleportedPlayers -- Attempts to get table of players

while (not teleportedPlayers) do task.wait() end
print(teleportedPlayers[1]) -- prints nil

Any help would be appreciated!

May be an issue with tpmodule as i cant see the source for that

I’m not sure what would be going wrong though, that’s the issue.

Bumping this to hopefully get this issue resolved.

Send the source of tpmodule and that would help as thats the only external factor

Fairly sure you cannot pass Instances through TeleportData. Pass names/userIds instead.

2 Likes

Okay, I will test this out!

characters

This worked, much appreciated!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.