local data = game:GetService("DataStoreService"):GetDataStore("SaveData")
game.Players.PlayerAdded:Connect(function(plr)
wait()
local plrid = "id_"..plr.UserId
local save1 = plr.leaderstats["Fool's"]
local save2 = plr.LocaleId.Multiplier
local GetSaved = data:GetAsync(plrid)
if GetSaved then
save1.Value = GetSaved[1]
save2.Value = GetSaved[2]
else
local nfs = {save1.Value,save2.Value}
data:GetAsync(plrid,nfs)
end
end)
game.Players.PlayerRemoving:Connect(function(plr)
data:SetAsync("id_"..plr.UserId{plr.leaderstats["Fool's"].Value,plr.leaderstats.Multiplier.Value})
end)
And output writing: “ServerScriptService.Scripts.Player.Player2.Data:13: attempt to index nil with ‘Value’” and " ServerScriptService.Scripts.Player.Player2.Data:18: attempt to call a number value".
Not sure what is causing the other error though. We need to see where you are creating the leaderstats. If you aren’t creating the leaderstats at all, lmk and I’ll figure something out.