local dataStore = game:GetService("DataStoreService"):GetDataStore("SaveData") game.Players.PlayerAdded:Connect(function(plr) wait() local plrid = "id_"..plr.UserId local save1 = plr.leaderstats.Wins

local GetSaved = dataStore:GetAsync(plrid)
if GetSaved then
	save1.Value = GetSaved[1]
else
	local NuberForSaving = {save1.Value}
	dataStore:GetAsync(plrid, NuberForSaving)
end

end)

game.Players.PlayerRemoving:Connect(function(plr) dataStore:SetAsync("id_"..plr.UserId{plr.leaderstats.Wins.Value}) end)


why does this only work in studio

I do not know if it is on the leaderstats script, datastore script or the wins on touch part script.

1 comment

1

Can you please try to properly use a code-box? This makes reading the code needlessly harder. Anyway – have you checked the Developer Console in-game for errors?