Why is my datastore showing that money has been added, but doesn't really add?
Here is an image of what i'm talking about.
Here is the datastore script i'm using.
local DSService = game:GetService("DataStoreService"):GetDataStore("Leaderstats")
game:GetService("Players").PlayerAdded:Connect(function(plr)
local uniquekey = ("id-"..plr.UserId)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = plr
local savevalue = Instance.new("IntValue")
savevalue.Name = "Money"
savevalue.Value = 500
savevalue.Parent = leaderstats
local savevalue2 = Instance.new("IntValue")
savevalue2.Name = "Gems"
savevalue2.Value = 0
savevalue2.Parent = leaderstats
local GetSaved = DSService:GetAsync(uniquekey)
if GetSaved then
savevalue.Value = GetSaved[1]
savevalue2.Value = GetSaved[2]
else
local NumbersForSaving = {savevalue.Value, savevalue2.Value}
DSService:SetAsync(uniquekey, NumbersForSaving)
end
end)
game:GetService("Players").PlayerRemoving:Connect(function(plr)
local uniquekey = ("id-"..plr.UserId)
local Savetable = {plr.leaderstats.Money.Value, plr.leaderstats.Gems.Value}
DSService:SetAsync(uniquekey, Savetable)
end)

4 comments
Doesn't really help us much, could you explain by what you mean for "doesn't really add"?
Did you check the photo? When money is added. It shows the money is added, but it isn't as you can see in the photo. When you print the money value it is the same as before!
Are you changing the money stat on the client?
Yes.