Datastore data problem

I have zero idea of what is happening! For hours I am trying to figure this out.

Before a player gets teleported in a game for a matchmaking service, I save their teleport data so it’s secure since the actual teleport data is client side.

Here is their data before they go into the game. I print the data to make sure this is the exact data that I save.

local teams = {
	Team1 = {
		player1 = {
			playerName = "Gold",
			teamColor = "Bright green"
		},
	},
	Team2 = {
		player1 = {
			playerName = "Yoo",
			teamColor = "Bright red"
		},
	}
}

And here is the data that comes out the other end.

local teams = {
	Team1 = {
		player1 = {
			playerName = "Gold",
			teamColor = "Bright green"
		},
	},
	Team2 = {
		player1 = {
			playerName = "Yoo",
			teamColor = nil
		},
	}
}

I can’t figure out why teamColor keeps coming out to nil. Seriously. I print the data right before I save it, and I print the data right after it loads. Both games use the same datastore. I doubt anything else is changing it because if so the playerNames would be different. I don’t know what you can do to help but this is worth posting because I cant fix whatever is happening…

Have you tried using something like Datastore Editor to confirm it’s being saved? The issue here seems like it’s not being saved or serialized properly.

Will need to see your saving and loading method to further help you with this problem, since those are the likely sources.

You probably have issue with values, if you read team color from String Values, make sure that code is proper, which means that you should always use TeamColor.Value when saving and never declare variable TeamColor = game.workspace.TeamColor.Value, because teamcolor could be changed and it will still remain same.