Detects that a player has data but doesn't load it in?

When I join the game, it detects me having saved data, but the values are all left default and don’t change when it’s supposed to load in.

game.Players.PlayerAdded:Connect(function(player)
	task.wait()
	local data = game.ServerStorage.PlayerDataFolder:Clone()
	data.Parent = player
	local playerid = "Player" .. player.UserId
	local data1 = mystore:GetAsync(playerid)
	
	local hasplayed = data.HasPlayed
	local language = data.Language
	local needstutorial = data.NeedsTutorial
	local timeplayed = data.TimePlayed
	local lives = data.NumberOfLives
	task.wait()
	
	if data1 then
		print("has data!")
		hasplayed.Value = data1['HasPlayed']
		language.Value = data1['Language']
		needstutorial.Value = data1['NeedsTutorial']
		timeplayed.Value = data1['TimePlayed']
		lives.Value = data1['NumberOfLives']
	else
		print("no data yet!")
		hasplayed.Value = false
		language.Value = nil
		needstutorial.Value = true
		timeplayed.Value = 0
		lives.Value = 0
	end

can you send how diid you SetAsync?

yeah. this is the server script:

function dataSave(player,toUpdate)
	local playerid = "Player" .. player.UserId
	local success, err = pcall(function()
		mystore:SetAsync(playerid,toUpdate)
	end)
	if success then
		print("data saved!" .. success .. toUpdate)
	else
		print(toUpdate)
	end
end

and this is the local script

local player = game:GetService("Players").LocalPlayer
local folder = player:WaitForChild("PlayerDataFolder")
local gameslot = folder.CurrentGame.Value

wait(3)

local toUpdate = {}

function updateDataStore()
		game.ReplicatedStorage.DataSave:FireServer(player,toUpdate)
		task.wait()
end

if folder.HasPlayed.Changed then
		print("value changed!")
		toUpdate.HasPlayed = folder.HasPlayed.Value
end

I just tried printing the toUpdate after a value change is supposed to be added to it and it’s nil. I’m guessing that’s the issue but I don’t know why it’s nil

its been 12 minutes since i started to watch my monitor for you code but for nothing

the only thing i could say is:

try to put something in it, like a placeholder variable and tell me if it works

When I print it in the local script, it’s just fine but after it goes to the server it’s nil