Passing values via TeleportService passes value incorrectly

I have a stringvalue in a folder within replicatedstorage that I put in a table to pass through teleportservice with :Teleport() to be received in another place within the game to be used in said place. Below is an image of replicatedstorage.

replicatedstorage layout

When the player finishes a character selection process, it fires a remote event to the server to teleport the player. Here is the relevant part of the script that runs when the remote event is fired:

CharacterSelectHandler.OnServerEvent:Connect(function(player, challenger)
    local Player1Data = {
	    player.PlayerValues.SelectedStand.Value
				
    }
			
	TeleportService:Teleport(FirstAvailablePlace, player, Player1Data)
end)

And here, inside a localscript in the second place:

local Player = game.Players.LocalPlayer
local ReplicatedStorage = game.ReplicatedStorage
local TeleportService = game:GetService("TeleportService")

local Character = Player.Character
if not Character or not Character.Parent then
	Character = Player.CharacterAdded:wait()
end

TeleportService.LocalPlayerArrivedFromTeleport:Connect(function(loadingscreen, TeleportData)
	print(TeleportData[1])
end)

So what this should do, is print the string that the SelectedStand value contained. However, it outputs this error.

Looking at this error, it seems that the value was passed through places successfully, however the script is attempting to index the physical value object itself, rather than just printing the provided value. Is this a bug, and how should I go about fixing this? Thanks :smiley:

Change your ServerScript to this:

CharacterSelectHandler.OnServerEvent:Connect(function(player, challenger)
    local Player1Data = {
	    player:WaitForChild("PlayerValues").SelectedStand.Value
				
    }
			
	TeleportService:Teleport(FirstAvailablePlace, player, Player1Data)
end)

That still gives the same error.

Try this:

CharacterSelectHandler.OnServerEvent:Connect(function(player, challenger)
    local Player1Data = {
	     data1 =  player:WaitForChild("PlayerValues").SelectedStand.Value
				
    }
			
	TeleportService:Teleport(FirstAvailablePlace, player, Player1Data)
end)