I have been trying to figure this out for three days. I have read all about :UpdateAsync but I must be doing something wrong. The first 3 lines are what Im trying instead of :SetAsync. Please help! It would be so very appreciated. Thank you so much!
game.Players.PlayerRemoving:connect(function(player) DataStore:UpdateAsync(player.Name, function(oldValue) return player.leaderstats.Rank.Value end) end) DataStore = game:GetService("DataStoreService"):GetDataStore("StatsService") game.Players.PlayerAdded:connect(function(player) repeat wait() until player:FindFirstChild("leaderstats") repeat wait() until player.leaderstats:FindFirstChild("Rank") repeat wait() until player.leaderstats:FindFirstChild("XP") repeat wait() until player.leaderstats:FindFirstChild("Kills") local PlrsRank = DataStore:GetAsync(player.Name .. "_Rank") local PlrsXP = DataStore:GetAsync(player.Name .. "_XP") local PlrsKills = DataStore:GetAsync(player.Name .. "_Kills") if PlrsRank ~= nil then player.leaderstats.Rank.Value = PlrsRank player.leaderstats.XP.Value = PlrsXP player.leaderstats.Kills.Value = PlrsKills end end) game.Players.PlayerRemoving:connect(function(player) if player:FindFirstChild("leaderstats") then if player.leaderstats:FindFirstChild("Rank") then DataStore:SetAsync(player.Name .. "_Rank", player.leaderstats.Rank.Value) end if player.leaderstats:FindFirstChild("XP") then DataStore:SetAsync(player.Name .. "_XP", player.leaderstats.XP.Value) end if player.leaderstats:FindFirstChild("Kills") then DataStore:SetAsync(player.Name .. "_Kills", player.leaderstats.Kills.Value) end end end)