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:

game.Players.PlayerAdded:Connect(function(Player)
    local Leaderstats = Instance.new("Folder")

    local Rank = Instance.new("StringValue")
    Rank.Value = "General"
    Rank.Parent = Leaderstats

    Leaderstats.Parent = Player
end)
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:

game.Players.PlayerAdded:Connect(function(plr)
    local stats = Instance.new("Model",plr)
    stats.Parent = game.Players.LocalPlayer
    stats.Name = "leaderstats"
    local rank = Instance.new("StringValue",stats)
    rank.Name = "Rank"
    local drank = Instance.new("StringValue",stats)
    drank.Name = "Divisional Rank"
    if game.Players.LocalPlayer.Name == "tictac67" then
        game.Players.LocalPlayer.leaderstats.Rank.Value = "Overseer"
    end
        if game.Players.LocalPlayer.Name == "tolly67p" then
        game.Players.LocalPlayer.leaderstats.Rank.Value = "O5-2"
    end
  if game.Players.LocalPlayer.Name == "MINECRAFT_LOLBUILDZ" then
        game.Players.LocalPlayer.leaderstats.Rank.Value = "Site Director"
end
  if game.Players.LocalPlayer.Name == "BrigamerGT" then
        game.Players.LocalPlayer.leaderstats.Rank.Value = "O5-X"
    end
end)

Answer this question