Purpose of this Series:
Good afternoon everybody! My name is @Obetius and I am beginning this series here today to first of all up my skills in the developmental world of Lua, but also to give the public something to tune into! So, we begin this journey here, right now, where we have a simple leaderstats script that will be evolved into a full-fledged system created and commanded by you all!
Every time we post here, there will be an added layer of advancement to this system, whether it’s a simple data storage change, or a completely new feature, it is guaranteed that this simple script will not be the same at the conclusion of this series.
The Starting Point:
Today, we’re kicking things off in this season with one of the most common and basic scripts known around the community, leaderstats
. What we have right now is a basic leaderstats script that makes a folder with a value of Coins that will be saved in the stats section of the player list.
Code Snapshot:
PlayerStats
--//PlayerStats/ServerScriptService
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local coins = Instance.new("IntValue")
coins.Name = "Coins"
coins.Value = 0
coins.Parent = leaderstats
end)