✓ Accepted answer
That script is disgusting, and I know good and well you didn't write it. Here's the proper way to make leaderstats. As a note, you just copy the given section to add another row to the leaderboard.
In a Server Script
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local rebirths = Instance.new("IntValue")
rebirths.Name = "Rebirths"
rebirths.Parent = leaderstats
local cash = Instance.new("IntValue")
cash.Name = "Cash"
cash.Parent = leaderstats
end)
So everytime a player joins, a folder will be created inside them called leaderstats. To create a built-in ROBLOX leaderboard, you are required to have a Folder or Model inside the player object named leaderstats, otherwise the well-known rows and columns will not be automatically created. To make the rows and columns, we create values inside the data container, such as Rebirths and Cash.
Another thing to note is that the Parent property should always be set last, due to the way ROBLOX changes objects' properties. Read this article for more information.
###P.S. Next time you post a question, click the Lua icon on your editor to make a codeblock. Then, put your code within the ~~~'s.
##Resources:
ROBLOX Leaderboards
##Accept and upvote if this helps!
4 comments
I put all code in a code block.
what is a code block?
https://forum.scriptinghelpers.org/topic/82/how-to-format-questions-answers-on-the-main-site
Please make your own scripts