local DSService = game:GetService('DataStoreService'):GetDataStore('ForgottenCollapse') game.Players.PlayerAdded:connect(function(plr) local uniquekey = 'id-'..plr.UserId local leaderstats = Instance.new('IntValue',plr) local savevalue = Instance.new('IntValue') leaderstats.Name = "leaderstats" savevalue.Parent = "leaderstats" savevalue.Name = ("Money")
local GetSaved = DSService:GetAsync(uniquekey) if GetSaved then savevalue.Value = GetSaved[1] else local NumbersForSaving = {savevalue.Value} DSService:SetAsync(uniquekey, NumbersForSaving) end end)
game.Players.PlayerRemoving:connect(function(plr) local uniquekey = 'id-'..plr.UserId local Savetable = {plr.leaderstats.Dollars.Value} DSService:SetAsync(uniquekey, Savetable)
end)
Closed as Non-Descriptive by chomboghai and Vulkarin
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?