Well I was making my custom leaderboard as I do, it all worked before but when I add DataStore support, it suddenly doesn't work. I don't know what the problem is and no errors occur. Here are the code chunks needed:
DataStore = game:GetService("DataStoreService"):GetDataStore("Values") game.Players.PlayerAdded:connect(function(player) local save = "plr-"..player.userId local savedVals = DataStore:GetAsync(save) if savedVals then val = savedVals else val = 0 DataStore:SetAsync(save, val) end local pts = Instance.new("IntValue", player) pts.Name = "Cash" pts.Value = val while wait() do newchatline.Text = player.Name.." - $"..pts.Value end end) game.Players.PlayerRemoving:connect(function(p) for _,v in pairs(game.Players:GetChildren()) do for _,x in pairs(v.PlayerGui.Leaderboard:GetChildren()) do if x.Text == p.Name then local z = x.Name:sub(4) x:Destroy() for _,y in pairs(v.PlayerGui.Leaderboard:GetChildren()) do if y.Name:sub(4) > z then y.Position = y.Position - UDim2.new(0, 0, 0, 29) end end end end end end) game.Players.PlayerRemoving:connect(function(plr) local val = plr.Cash.Value local save = "plr-"..plr.userId DataStore:SetAsync(save,val) end)