How would I make a points system that is added all together gathered from a group?

How would I make a points system that is added all together gathered from a group?
This script doesn’t seem to sync properly with all servers, however not tested it enough.

local GlobalDataStore = game:GetService(“DataStoreService”):GetOrderedDataStore(“TestServer1”)
for _,Player in pairs(game.Players:GetPlayers()) do
if Player:IsInGroup(Player.Data.Group.Value) then
local success, err = pcall(function()
GlobalDataStore:UpdateAsync(Player.Data.Group.Value, function(oldValue)
local newValue = oldValue or 0
newValue = newValue + Player.Data.Points.Value
return newValue
end)
end
end