I am making a hide and seek game and I need to figure out how to save wins. Here is a basic leaderboard script I used.
local function onPlayerJoin(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local gold = Instance.new("IntValue")
gold.Name = "Gold"
gold.Value = 0
gold.Parent = leaderstats
end
game.Players.PlayerAdded:Connect(onPlayerJoin)
It only works for the session in-game, but when I leave it doesn't save.

1 comment
use datastores