Need help adding saving data to leaderstats

game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new(“Folder”)
leaderstats.Name = “leaderstats”
leaderstats.Parent = player

local clicks = Instance.new("IntValue")
clicks.Name = "Clicks"
clicks.Value = 0
clicks.Parent = leaderstats

local rebirths = Instance.new("IntValue")
rebirths.Name = "Rebirths"
rebirths.Value = 0
rebirths.Parent = leaderstats

end)

You can just change the Value property of either of your IntValues. Ensure that all of this is being done from the server as well for proper replication. For more information, read more here: In-Experience Leaderboards | Documentation - Roblox Creator Hub

Remember though (in reference to the title of this question), this is not ‘saving data’, this is just ‘displaying data’ (in the sense that data can be anything). Saving data involves storing it an external location (ex: Roblox Datastores or an external site) and then retrieving it later. Data can be saved, retrieved, and then displayed on leaderstats, but simply displaying in leaderstats will not save your data.