Question about encoding data and sending teleport data

So when I run my teleporting script where I send some data through it, I receive an error “Unable to cast value to std::string.” When I looked this error up I saw discussions about encoding data using Http service and JSONEncode and JSONDecode. Can anyone explain what this does and if it’s necessary for sending teleport data? I have never seen these functions before and an explanation on how they’re needed for teleport data would be appreciated.

i think that JSON is pretty confusing tough but what he does is actually converting all variables and values on your table to strings and the Decode one convert to the normal variables that this table had before

On the dev hub, it says that teleportData says that the teleport data can be a table, string, number or boolean. You don’t need JSONEncode.

So I’m guessing the issue is just that the data I’m sending is not in one of the correct formats? The data I’m sending is a table filled with tables which are filled with strings, like this:

teleportData = {{"player's name", "player's name"},{"player's name", "player's name"}}

I’m not sure if this is an allow format

If that’s what it does then I don’t think I will need to use it because my data is already in string, so there must be another issue.

The table isn’t mixed, so it should be fine.

Ok thanks I’ll go review my code. I think my issue is that it’s putting the player objects into the arrays, not their names. I’m trying to make it so that the teams in the main server are transferred into the next place (just the members not the team name/color or anything), so my solution was to put each team in an arrays and fill the team arrays with player names. If you know a better solution I’d be glad to hear it

Yes that would be the issue. Also I reccomend putting their UserIds instead, as a new,e can change between teleports and would break your game.

Alright, I will use the Id’s instead