I have a leaderboard script for leaderstats that works and, I would like to save it. From everything I'm reading online I don't really understand. I'm looking for links that will help me understand and a few answers to my questions code provided below. This is in ServerScriptStorage with a Folder inside of it called leaderstats. API Services was turned on right after I made the leaderstats script.
I don't understand this, it doesn't seem to fit with mine. https://developer.roblox.com/en-us/onboarding/intro-to-saving-data/1
local players = game:GetService("Players")
local function leaderboardSetup(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local tix = Instance.new("IntValue")
tix.Name = "Tix"
tix.Value = 0
tix.Parent = leaderstats
end
players.PlayerAdded:Connect(leaderboardSetup)
while true do
wait(1)
local playerList = players:GetPlayers()
for currentPlayer = 1, #playerList do
local player = playerList[currentPlayer]
local tix = player.leaderstats.Tix
tix.Value = tix.Value + 1
end
end
When I make the save/load do I put it in the same script if not, do I put it in a script or local script in ServerScriptStorage? Will this script I have work with a save/load? What can I do or what can I change? Help and explanations are appreciated. Thank you in advance.

2 comments
Thank you very much TheBigBro122, I appreciate it. The video explained better than any link I found. I'm going to do some testing and I'll let you know what I end up with. Thanks again!
I did some testing after watching the video so I could learn for myself. After comparing my script to yours, everything works perfect! Thanks again, very much appreciated for the help and link.