local dataStore = game:GetService("DataStoreService"):GetDataStore("DiceomathyData")
local datst = game:GetService("DataStoreService"):GetDataStore("DiceomathyDataPoint")
starterRolls = 0 --This is the starter money
starterPoints = 0
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = plr
local points = Instance.new("IntValue")
points.Name = "Points" --Put ur currency name here, mine is Money
points.Value = dataStore:GetAsync(plr.UserId) or starterPoints
points.Parent = leaderstats
local rolls = Instance.new("IntValue")
rolls.Name = "Rolls" --Put ur currency name here, mine is Money
rolls.Value = dataStore:GetAsync(plr.UserId) or starterRolls
rolls.Parent = leaderstats
end)
game.Players.PlayerRemoving:Connect(function(plr)
dataStore:SetAsync(plr.UserId, plr.leaderstats.Rolls.Value)
end)
game.Players.PlayerRemoving:Connect(function(plr)
datst:SetAsync(plr.UserId, plr.leaderstats.Points.Value)
end)
My script seems to be saving the data, but... not properly. When I add the points to let's say, 123, and rolls to 0. Then when I come back the points is now 0 and rolls is 0. I tried again with different values. 100 for points, 10 for rolls, when I rejoined my game, both values were 100. I would like a person out there to figure out how to get both values separately saved.

1 comment
Simple, "points.Value = dataStore" and "rolls.Value = dataStore". Same datastore, change "rolls" to "rolls.Value = datst"