I also wanted to let you that that FE is on and the script is in the workspace
local DSService = game:GetService("DataStoreService"):GetDataStore("Currency")
game:GetService("Players").PlayerAdded:connect(function(plr)
local leader = Instance.new("Folder",plr)
leader.Name = "leaderstats"
local Credits = Instance.new("IntValue",leader)
Credits.Name = "Credits"
local Diamonds = Instance.new("IntValue",leader)
Diamonds.Name = "Diamonds"
local savedData = DSService:GetAsync(plr.UserId.."-Currency")
if savedData then
Credits.Value = savedData[1]
Diamonds.Value = savedData[2]
else
local values = {Credits.Value, Diamonds.Value}
DSService:SetAsync(plr.UserId.."-Currency",values)
end
end)
game:GetService("Players").PlayerRemoving:connect(function(plr)
local ValuesToSave = {plr.leaderstats.Credits.Value, plr.leaderstats.Diamonds.Value}
DSService:SetAsync(plr.UserId.."-Currency", ValuesToSave)
end)
while wait(300) do
for i,v in pairs(game:GetService("Players"):GetChildren()) do
DSService:UpdateAsync(v.UserId,v.leaderstats.Credits.Value,v.leaderstats.Diamonds.Value)
end
end

3 comments
What’s the issue? I don’t have a computer to find errors at the moment.
How are you changing the values?
I already tested your script , it works fine... workspace > Script ( Above content ) Press F9 > Server log then game.Players.NAMEHERE.leaderstats.Diamonds.Value = 9999.