the text prints every time and the leader stats show, but it never saves.
local DS = game:GetService("DataStoreService"):GetDataStore("storage") game.Players.PlayerAdded:Connect(function(plr) local stats = Instance.new("Folder") stats.Name = "leaderstats" stats.Parent = plr local Soul = Instance.new("IntValue") Soul.Name = "Cash" Soul.Parent = stats Soul.Value = DS:GetAsync(plr.UserId) or 0 DS:SetAsync(plr.UserId,Soul.Value) Soul.Changed:Connect(function() print("saving") DS:SetAsync(plr.UserId,Soul.Value) print("finished saving") end) end) game.Players.PlayerRemoving:Connect(function(plr) print("saving data") DS:SetAsync(plr.UserId,plr.leaderstats.Cash.Value) print(plr.Name.."'s scream data has been saved") end)
sorry about the code for some reason scripting helpers spaces it out when i paste it
Did you check if your game has API services enabled. Also if this is in a team-create, those are kinda buggy.