Hey, Im making a simulator sort of game, and want to try to use datastore to do this. When I test this program it doesn't seem to save it (also in workshop in console it reads "18:51:39.812 - DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 84828376 (x2)")
I followed a yt tutorial fyi
local Players = game:GetService("Players")
local DataStore = game:GetService("DataStoreService")
local ds1 = DataStore:GetDataStore("PlayerMoneySave")
local ds2 = DataStore:GetDataStore("PlayerPopulationSave")
local ds3 = DataStore:GetDataStore("PlayerSoulsSave")
Players.PlayerAdded:Connect(function(player)
--Create the folder to store the data
local Statistics = Instance.new("Folder", player)
Statistics.Name = "Statistics"
--Create the data holders
local Money = Instance.new("IntValue", Statistics)
local Population = Instance.new("IntValue", Statistics)
local Resources = Instance.new("Folder", Statistics)
local Souls = Instance.new("IntValue", Statistics)
--Renames the data holders
Money.Name = "Money"
Resources.Name = "Resources"
Population.Name = "Population"
Souls.Name = "Souls"
--Money Data Sync
Money.Value = ds1:GetAsync(player.UserId) or 1000
ds1:SetAsync(player.UserId, Money.Value)
Money.Changed:connect(function()
ds1:SetAsync(player.UserId, Money.Value)
end)
-------------------------
--Population Data Sync
Population.Value = ds2:GetAsync(player.UserId) or 0
ds2:SetAsync(player.UserId, Population.Value)
Population.Changed:connect(function()
ds2:SetAsync(player.UserId, Population.Value)
end)
-------------------------
--Souls Data Sync
Souls.Value = ds3:GetAsync(player.UserId) or 5
ds3:SetAsync(player.UserId, Souls.Value)
Souls.Changed:connect(function()
ds3:SetAsync(player.UserId, Souls.Value)
end)
end)
Players.PlayerRemoving:Connect(function(player)
ds1:SetAsync(player.UserId, player.Statistics.Money.Value)
ds2:SetAsync(player.UserId, player.Statistics.Population.Value)
ds3:SetAsync(player.UserId, player.Statistics.Souls.Value)
end)

2 comments
Research DataStore2 services. It's easier to use and more reliable. It's stat loss prevention and it cache's data until the player leaves and then it saves so it doesn't lag as much. It's really useful. If you want I can answer it with a script for your curiosity if you're wondering.
If you would be able to, that would be handy! Thanks