So I’m making a game that requires players to be teleported to another place. That place in question will then load a model depending on the map the players previously chose. However, I always get this error when teleporting: “Unable to cast value to std::string” in the dev console.
Teleport Code:
teleportService:TeleportToPrivateServer(placeId, code, teleportList, {["SelectedMission"] = selectedMission})
Teleport Receiver Code (In the place to be teleported to):
local players = game:GetService("Players")
local approvedId = blahblah
players.PlayerAdded:Connect(function(player)
local joinData = player:GetJoinData()
if joinData.SourcePlaceId == approvedId then
local teleportData = joinData.TeleportData
if teleportData then
script.Parent.SurfaceGui.TextLabel.Text = tostring(teleportData.SelectedMission)
end
end
end)
I have absolutely no idea what that error means and I haven’t had much success searching it up. Any help would be appreciated.