local datastore = game:GetService("DataStoreService")
local ds1 = datastore:GetDataStore("KeysSaveSystem")
local ds2 = datastore:GetDataStore("CashSaveSystem")
game.Players.PlayerAdded:connect(function(plr)
local folder = Instance.new("Folder", plr)
folder.Name = "leaderstats"
local Keys = Instance.new("IntValue", folder)
Keys.Name = "Keys"
local cash = Instance.new("IntValue", folder)
cash.Name = "Cash"
Keys.Value = ds1:GetAsync(plr.UserId) or 0
ds1:SetAsync(plr.UserId, Keys.Value)
cash.Value = ds2:GetAsync(plr.UserId) or 0
ds2:SetAsync(plr.UserId, cash.Value)
Keys.Changed:connect(function()
ds1:SetAsync(plr.UserId, Keys.Value)
end)
cash.Changed:connect(function()
ds2:SetAsync(plr.UserId, cash.Value)
end)
end)
COMMUNITY QUESTION
Hi i was wondering if anyone could help me understand why my save stats script isn't working?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.
