Script reading the wrong value?

I’ve been working on a datastore script over the past few days, and I ran into a weird error. When trying to save a value, for some reason my script will only read the information from the last save, meaning that despite the value I’m trying to save has changed, it will always read an old value. I have seen other posts like this where the developer made the variable for the value before it had changed, but my variable is always being created after the saving function has started, so I have no clue why this is happening.

The value in properties:

That same value being saved:

Code: : Player)
	local Foldername = ("p" .. Player.UserId)
	local tokens = workspace:WaitForChild("PlayerValues"):WaitForChild(Foldername):WaitForChild("dataValue").Value
	local info = {
		Tokens = tokens;
		id = tostring(Player.UserId);
		message = "Hello, there.";

		playerStuff[Player.UserId].Data.FrenzyTokens = info.Tokens
		print("Saved! You have " .. info.Tokens .. "  Tokens.")

If this is a little confusing, I can try to elaborate. It’s confusing me too, lol

I think it might be because you are referencing the Value directly, try referencing the object and manually the Value

Hello try to change token value on the server side


Maybe the tokens change on local scripts.

playerStuff[Player.UserId].Data.FrenzyTokens = info.Tokens.Value

idk, seems to be a missing .Value someplace.

Are you sure you arent changing the value on the client?