I have my leaderboard properly made. I need it to save using data stores, but my script isn't working.
datastore = game:GetService("DataStoreService"):GetDataStore("Growth") game.Players.PlayerAdded:connect(function(player) player:WaitForDataReady() wait(1) local stats = player:FindFirstChild("leaderstats").Growth.Value stats = datastore:GetAsync(player.UserId) end) for i,v in pairs(game.Players:GetChildren()) do for x,c in pairs(v:FindFirstChild("leaderstats")) do for a,b in pairs(c:FindFirstChild("Growth")) do b.Changed:connect(function() datastore:SetAsync(v.UserId, b.Value) end) end end end
Try replacing FindFirstChild with WaitForChild. Also don't do this, because if the value defined is to be changed, the old one is still saved.
value = test.Value print(value)
use this instead
value = test print(test.Value)