So the script im using to make and save and load the leaderboard + Money is not working and i have spend way to much time trying to fix it and it still doesn't work.
The Script:
local DataStoreService = game:GetService("DataStoreService")
local MoneyDataStore = DataStoreService:GetDataStore("MoneyStats")
game.Players.PlayerAdded:Connect(function(Player)
local Leaderboard = Instance.new("Folder", Player)
Leaderboard.Name = "Leaderboard"
local Money = Instance.new("IntValue", Leaderboard)
Money.Name = "Money"
local Data = MoneyDataStore:GetAsync(Player.UserId)
if Data then
Money.Value = Data
end
end)
game.Players.PlayerRemoving:Connect(function(Player)
MoneyDataStore:SetAsync(Player.UserId, {
["Money"] = Player.Leaderboard.Money.Value;
})
end)

2 comments
Just use setasync like this: MoneyDataStore:SetAsync(Player.UserId, Player.Leaderboard.Money.Value)
And you should use pcall. They are important.