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

Custom leader stats rank?

Asked by 6 years ago

Is there a way I can make custom leader stats that display ranks? I want to be able to set the persons rank not in a group (because I do not own one) and then it to show up in the leaderboard

0
Just use an IntValue dude User#6546 35 — 6y

2 answers

Log in to vote
1
Answered by
Avigant 2374 Moderation Voter Community Moderator
6 years ago

Yes. The requirement for using the default leaderboard GUI is that you insert an object of any class (a Folder is best) named exactly (case-sensitive) "leaderstats".

After that, simply create and set value objects (anything inheriting from ValueBase) into the leaderstats.

For example:

1game.Players.PlayerAdded:Connect(function(Player)
2    local Leaderstats = Instance.new("Folder")
3 
4    local Rank = Instance.new("StringValue")
5    Rank.Value = "General"
6    Rank.Parent = Leaderstats
7 
8    Leaderstats.Parent = Player
9end)
0
Would I be able to set custom ranks for people? tictac67 96 — 6y
0
Yes, you would. Avigant 2374 — 6y
0
Would it be possible for you to write out a script for it? I am no very good at scripting tictac67 96 — 6y
0
I did, you'd just want to modify my code to include setting Rank.Value to whatever you want for the player. Avigant 2374 — 6y
View all comments (2 more)
0
How would I set the player I want it for? tictac67 96 — 6y
0
I am very confused tictac67 96 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

I managed to do it with this:

01game.Players.PlayerAdded:Connect(function(plr)
02    local stats = Instance.new("Model",plr)
03    stats.Parent = game.Players.LocalPlayer
04    stats.Name = "leaderstats"
05    local rank = Instance.new("StringValue",stats)
06    rank.Name = "Rank"
07    local drank = Instance.new("StringValue",stats)
08    drank.Name = "Divisional Rank"
09    if game.Players.LocalPlayer.Name == "tictac67" then
10        game.Players.LocalPlayer.leaderstats.Rank.Value = "Overseer"
11    end
12        if game.Players.LocalPlayer.Name == "tolly67p" then
13        game.Players.LocalPlayer.leaderstats.Rank.Value = "O5-2"
14    end
15  if game.Players.LocalPlayer.Name == "MINECRAFT_LOLBUILDZ" then
View all 21 lines...

Answer this question