Ok so I made this script that makes you save your values when you leave using datastore theres 2 values but one called "Money" won't save
I am also using a sell script that turns your wood into money idk but i think it might have to do with something in saving
game.Players.ChildAdded:connect(function(Player)
local Lead = Instance.new("IntValue",Player)
Lead.Name = "leaderstats"
local Cash = Instance.new("IntValue",Lead)
Cash.Name = "Wood"
Cash.Value = 0
local Cash2 = Instance.new("IntValue",Lead)
Cash2.Name = "Money"
Cash2.Value = 0
DataStore = game:GetService("DataStoreService"):GetDataStore("SaveCash")
local Key = Player.userId
local Data = DataStore:GetAsync(Key)
if Data then
Cash.Value = Data
end
end)
game.Players.ChildRemoved:connect(function(Player)
local Key = Player.userId
DataStore:SetAsync(Key,Player.leaderstats.Wood.Value)
DataStore:SetAsync(Key,Player.leaderstats.Money.Value)
end)
When I leave it says this:
DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 46681528
