When your code runs, the player character is not loaded into the game. So you need to add wait. Local Player = game:GetService('Players').LocalPlayer local character = Player.Character or Player.CharacterAdded:Wait local HumanoidRootPart = character:WaitForChild('HumanoidRootPart') - setting speed local Humanoid = character:WaitForChild('Humanoid') if Humanoid then Humanoid.WalkSpeed = 25 end. Not to be confused with Player list, as well as the discontinued feature on game details page that utilized player points. In Roblox, a leaderboard is a display of players' stats. Leaderboard stats often includedKOs/WOs, currency, level and EXP, time played and round survived. A leaderboard is created by placing a value named 'leaderstats' inside of a player, and then by placing values inside.
Easy Written By aidan29251
This is a simple tutorial on how to make a leaderboard.
Do you ever join cafe games? Homestores? Maybe even simulators? What is the first thing you do when you join the game? LOOK AT THE LEADERBOARD
Although leaderboards don't get as much credit as they should, and you think they are in every game? They are a nice way of keeping track of ranks, how many coins someone has, and how far someone is in a game. Who knows what you can do.
In this tutorial, I will be showing you how to make a leaderboard that keeps track of leaderstats every player in the server has.
You are probably tired of me talking. Lets gets started!
This section will teach you how to make your average leaderboard.
In the Explorer tab, under ServerScriptService, create a new script named PlayerSetup.
Next, go into that script and add a function named onPlayerJoin() with a parameter named player.
In onPlayerJoin(), create a variable named leaderstats as a new Folder instance. All the stats for the player will be stored in this folder.
Name the folder leaderstats and parent it to the player. If the folder is not named leaderstats, Roblox Studio won’t be alerted to create a leaderboard.
After the closing end of the function, connect onPlayerJoin() to the PlayerAdded event. Whenever a player joins the game, the onPlayerJoin() function will run.
Now that the leaderboard script is done, time to add the stats.
WARNING: IF YOU SKIP THIS PART, YOUR LEADERBOARD WON'T WORK
In onPlayerJoin(), under leaderstats.Parent = player, create a new variable. You can choose a name. I will choose 'Gold'.
Type gold.Name = 'Coins'.This is the name that will appear in the leaderboard. You may change it to anything.
If you don't want the players to start with any currency, add gold.Value = 0
If you want the players to start with some currency, change it to gold.Value = 250However much you want everyone to start with.
Type gold.Parent = leaderstats. This parents the IntValue for gold to leaderstats.
WARNING: DOSEN'T SAVE
The diffuculty is set to easy, so this currently does not explain how to save. If the rating for this tutorial is over 4 stars, I will make a tutorial for how to save the leaderstats.
Thanks for all your support, this is my first tutorial. I will hopefully maybe make a series that will make whatever you guys suggest. The best way to contact me is through roblox messaging. I will make any tutorial you guys like! :)
Made by Aidan29251 & GRRROI
This was created on December 22, 2019
Easy Written By aidan29251
See aidan29251's profile on Roblox
- game.Players.PlayerAdded:connect(function(player)
- leaderstats.Name = 'leaderstats'
- local money = Instance.new('IntValue') --We create a new IntValue
- money.Name = 'Money' --this is the name you want the leader-stat to be when it shows up in-game.
- money.Value = 0 --this is the value of money the new player starts out with. To change this, you can add some more code (shown later)
- money.Parent = leaderstats -- Set the money object as a child of the leaderstats object.
- game.Players.PlayerAdded:connect(function(player)
- leaderstats.Name = 'leaderstats'
- local money = Instance.new('IntValue')
- money.Value = 0
- end)
- while wait(5) do
- for _, player in ipairs(game.Players:GetPlayers()) do
- player.leaderstats.Money.Value = player.leaderstats.Money.Value + 1
- end