Error in passing info through join data?

i want to pass the players face textureid to the other place. everytime i do this it results in failure.

server side script

	if parties:FindFirstChild(party) then
					local playersToTeleport = {}
					
				
					for _, member in pairs(parties[party].Members:GetChildren()) do
					table.insert(playersToTeleport, game.Players[member.Name])
				
				end
				
				for _, plr in pairs(playersToTeleport) do
					re:FireClient(plr,15)
					print(plr.Character.Head.Face.Texture)

					local fma = plr.Character.Head.Face.Texture

local teleportData = {



					jobId = game.JobId;
					-- I WANT FACEID TO BE TRANSFERED
faceid  = fma

				}
					qs:FireAllClients("display")
teleportOptions:SetTeleportData(teleportData)
				tps:TeleportPartyAsync(placeId, playersToTeleport, teleportOptions)
				end
				
				

				

i need faceid to be passed

server script on the server being teleported to

players.PlayerAdded:Connect(function(plr)
	
	
	local joinData = plr:GetJoinData()
print("jdata",joinData)
	
	local rqac = joinData.TeleportData 
	print("qaca",rqac)
	for ind, val in pairs(rqac)  do
		print(ind, val)
	end
	wait(2)
	local faceaa = rqac.fma





	
	


	print("face",faceaa)
	
	chr:WaitForChild("Head").Face.Texture = faceaa
	
	
		
		
	end)
end)

everytime i try this, it gives me nil error on the table. like the joindata . teleportdata is not working?? im not sure please help.

You’re assigning faceid = fma, and fma is defined by plr.Character.Head.Face.Texture, check that fma is being assigned correctly and isn’t nil

Also in your rqac table, you’re trying to access rqac.fma, but isn’t your key faceid in your teleportData?

If so, then the following should work:

if parties:FindFirstChild(party) then
    local playersToTeleport = {}
    
    for _, member in pairs(parties[party].Members:GetChildren()) do
        table.insert(playersToTeleport, game.Players[member.Name])
    end
    
    for _, plr in pairs(playersToTeleport) do
        local fma = plr.Character and plr.Character.Head and plr.Character.Head.Face and plr.Character.Head.Face.Texture
        if fma then
            local teleportData = {
                jobId = game.JobId,
                faceid = fma,
            }
            qs:FireAllClients("display")
            teleportOptions:SetTeleportData(teleportData)
            tps:TeleportPartyAsync(placeId, playersToTeleport, teleportOptions)
        end
    end
end

and your server side script for receiving the player data:

players.PlayerAdded:Connect(function(plr)
    local joinData = plr:GetJoinData()
    local rqac = joinData.TeleportData 
    if rqac then
        local faceaa = rqac.faceid
        if faceaa then
            chr:WaitForChild("Head").Face.Texture = faceaa
        end
    end
end)

this didnt work . idk why but it still didnt functionally call faceaa from the joindata. like the joindata isnt even being called? when i print the join data it shows a string, but when i print the teleport data itself, its nil.

Check out the docs for GetJoinData() here

1 Like