One out of the 2 stats on my leader board are not saving and I have tried for the last hour to fix it but I hade no luck so maybe someone here can help :)
PointData = game:GetService("DataStoreService"):GetDataStore("PointData") Bought = game:GetService("DataStoreService"):GetDataStore("Bought")
game.Players.PlayerAdded:Connect(function(plr) local LB = Instance.new("IntValue") LB.Name = "leaderstats"
local p = Instance.new("IntValue") p.Name = "Points" p.Value = PointData:GetAsync(plr.userId) or 0 local r = Instance.new("IntValue") r.Name = "Bought" r.Value = Bought:GetAsync(plr.userId) or 0 LB.Parent = plr p.Parent = LB r.Parent = LB
end)
game.Players.PlayerRemoving:Connect(function(plr) PointData:SetAsync(plr.userId, plr.leaderstats.Points.Value) Bought:SetAsync(plr.userId, plr.leaderstats.Bought.Value) end)
It dose not save the bought stat I use the bought to keep track of what they bought and so everyone else can see how much stuff they bought but it dosent save.