Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a leaderboard with group ranks?

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

✓ Accepted answer
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)

1 comment

0

if it works then accept my answer :)

This discussion is preserved as it was. New answers, comments, and votes are closed.