Here's the script: It always attempts to load but says there isn't anything there, im sure the problem is at the green dashed line.
DataStore = game:GetService("DataStoreService"):GetDataStore("BSI") Players = game:GetService("Players") game.Players.PlayerAdded:connect(function(player) local Kills = Instance.new("IntValue", leader) Kills.Name = "Kills" local key = "user "..player.userId local Saved = DataStore:GetAsync(key) print (Saved[1]) Kills.Value = Saved[1] or 0 DataStore:SetAsync(key, Saved[1]) print (key, Saved[1]) end) game.Players.PlayerRemoving:connect(function(player) local key = "user "..player.userId print (key.." left") local ToSave = player.leaderstats.Kills.Value print (ToSave.." value") DataStore:SetAsync(key, 1 == ToSave) ----------------------- print (key, ToSave) print 'SAVED' end)
If you're trying to save a condition, then on line 22, it has to be "ToSave == 1." This is because the computer thinks like "this value is this number," not "this number is this value."