I showed how to make leaderstats in one of my lastest tutorials. But heres how to do it with words.
Firstly, You want to make a function that plays whenever the local player has joined. Lets start doing this with a quick line.
game.Players.PlayerAdded:Connect(function(Player)
This does not just wait for the “player” to join but makes a variable to access the local player with function(Player)
Now, we are going to make a folder that inserts itself into the player. We are also using the variable we previously made.
local stats = Instance.new("Folder", player) -- Makes a "Folder" and inserts inside the player.
stats.Name = "leaderstats" -- Names the folder to "leaderstats"
end)
That was not too bad! Im doing this step by step to get it locked in your head.
Now, with one of the most important parts, we will make the values!
Before we do this, I want to introduce you to StringValues. StringValues are not numbers, but words turned into values.
This is how were gonna put words into stats. Heres the line of code:
local Example = Instance.new("StringValue", stats) -- Makes a strinvalue, which we will use for the stats. Also imports the value inside of leaderstats.
Example.Name = "ExampleName" -- Names the value, which will be displayed in game and can be accessed throughout your scripts.
Example.Value = "Your Value" -- Will be the value that displays in stats.
That’s all! I hope this helps you!
By Sea_KidTwelve recognized as Aj!