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

How do you make a leaderboard with group ranks?

Asked by 4 years ago

This does not work

local players = game:WaitForChild("Players")

local function createLeaderboard(player)
    local stats = Instance.new("Folder")
    stats.Name = "leaderstats"
    local rank = Instance.new("StringValue", stats)
    rank.Name = "Ranking"   
    rank.Value = "Guest"
    stats.Parent = player
end
game.Players.PlayerAdded:Connect(function(player)
        local playerrank = player:GetRoleInGroup(550113)
      if playerrank == "Owner" then
        rank.Value = "Owner"
    end
end)
players.PlayerAdded:connect(createLeaderboard)

1 answer

Log in to vote
0
Answered by 4 years ago
local players = game:GetService("Players")

local groupid = PUT YOUR GROUP ID HERE

local function createLeaderboard(player)
    local stats = Instance.new("Folder")
    stats.Name = "leaderstats"
    local rank = Instance.new("StringValue", stats)
    rank.Name = "Ranking"   
    rank.Value = player:GetRoleInGroup(groupid)
    stats.Parent = player
end

game.Players.PlayerAdded:Connect(function(player)
      createLeaderboard(player)
end)
0
if it works then accept my answer :) ZorbaTheGreatGreek 59 — 4y
Ad

Answer this question