Hunt down the classic save-and-load bugs — swapped keys, missing defaults, and a leaderboard that never appears.
Data bugs are sneaky because they don't always error — a save can write garbage, a new player can crash, and a leaderboard can silently never appear. The good news: each one has a smell. Match the smell to the cause, and the fix is usually one line.
Your game saves, but every player loads someone else's coins. The code runs with no error — the arguments are just in the wrong order.
coinsStore:SetAsync(coins, player.UserId)
Write the corrected line with the arguments in the right order.
The first time a brand-new player joins, the game errors on the line that reads their coins.
local coins = coinsStore:GetAsync(player.UserId)
print(player.Name .. " has " .. coins .. " coins")
Write the corrected load line so a brand-new player gets 0, not nil.
Your game runs with no errors, but the leaderboard at the top-right never shows up.
local stats = Instance.new("Folder")
stats.Name = "Leaderstats"
stats.Parent = player
Write the corrected line — the folder must use the exact name Roblox looks for.
The game saves, but every returning player starts at zero. No errors — the save just ran too early to be useful.
Players.PlayerAdded:Connect(function(player)
coinsStore:SetAsync(player.UserId, player.leaderstats.Coins.Value)
end)
Write the corrected event header so the save runs as the player leaves.
A returning player should get their saved coins back. Spot the missing piece and type the corrected load line.
local coins = coinsStore:GetAsync(player.UserId)
Write the line that loads the player's coins, defaulting a missing save to 0.
Assemble the trusted click: the client reports, the server verifies and awards. Put the lines in order.