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

How to make Group Custom Rank Leaderstats?

Asked by 3 years ago

I'm trying to make a Custom Group Rank Value

If roleId == 0 then -- Guest Rank
      rank.Value = "Awaiting Rank"
elseif roleId == 78 then
      rank.Value = "PVT"
end

but it's not working, plz help

1 answer

Log in to vote
0
Answered by 3 years ago

Hiya!

Roblox has an easy way to the player's role in a group

Roles and Ranks are different things,

Rank returns the player’s rank in the group as an integer between 0 and 255, where 0 is a non-member and 255 is the group’s owner.

Role returns the player’s role in the group as a string, or Guest if the player isn’t part of the group.

If you want to do this in an efficient way, you can use

local role = Player:GetRoleInGroup(0123456)
print(role) -- > Administrator

to get the player's role.

But if you want to change a rank to a specific value, you can use Rank and tables

local rank = Player:GetRankInGroup(0123456)
local table = {
    [1] = "Unranked",
    [2] = "Private",
    [255] = "Major"
}
print(rank) -- > 255
print(table[rank]) -- > Major
Ad

Answer this question