How to make leaderstats with "words"

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!

This is a very Basic Tutorial that you can easily find on YouTube, or anywhere else, Creating a Tutorial this basic is mostly against the rules:


Rule:

  • Convey a significant amount of information; do not post extremely basic tutorials on topics such as Studio usage (the Developer Hub 176 probably explains it already), or Lua (many basic “learn Lua” topics already exist).
    About the Community Tutorials category

1 Like

this is a pretty common use already when people can literally search it up on google roblox how to make leaderstats, and you really dont need to post a 2023 version

dont do that
according to sources parenting new instances can cause severe performace issues

1 Like