Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How would I make a custom leaderboard/healthbar etc?

Asked by 10 years ago

I know how to take away the core guis, but how would I make a custom leaderboard or healthbar.

1 answer

Log in to vote
-2
Answered by 10 years ago

1) To make a leaderboard, you will have to start by inserting an object named 'leaderstats' into each player:

game.Players.PlayerAdded:connect(function(player) --We create a function that will execute when PlayerAdded fires.
     local leaderstats = Instance.new("Model", player) --We insert an Model into the the new player (player)
     leaderstats.Name = "leaderstats"
 end) --closes function

2) Now, we will add the different values, such as the Money, KO's, and Wipeouts, to the leaderstats container. In this tutorial, we will only have a Money section. To do this, all you have to do is add an 'IntValue' object as a child of the 'leaderstats' container.

game.Players.PlayerAdded:connect(function(player)
     local leaderstats = Instance.new("Model", player)
     leaderstats.Name = "leaderstats"

     local money = Instance.new("IntValue", leaderstats) --We instance a new IntValue as a child of 'leaderstats'
     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)
 end)
0
I think he ment re-creating a core gui leaderboard. Not the leaderstats. But good answer none the less :P YellowoTide 1992 — 10y
0
Yeah, I meant making my own leaderboard. That isn't working :P SchonATL 15 — 10y
Ad

Answer this question