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

This script makes my player rank show up as '252' when on the Dark Blue team. Why is this?

Asked by 4 years ago
Edited 4 years ago
local BBGUI = game.ServerStorage.BillboardGui

local GID = 6209170

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        if player.TeamColor.Name == "Deep orange" then
            local CGUI = BBGUI:Clone()
        CGUI.TextLabel.Text = player.Name.."\n".."Inmate"
            CGUI.Parent = game.Workspace:WaitForChild(player.Name).Head
        elseif player.TeamColor.Name == "Dark blue" then
            local CGUI = BBGUI:Clone()
        CGUI.TextLabel.Text = "[CLASSIFIED]".."\n"..player:GetRankInGroup(GID)
            CGUI.Parent = game.Workspace:WaitForChild(player.Name).Head
          end
       end)
      end)

When I switch over to the Dark blue team, the rank shows up as '252'.

0
Do you not want it to show your rank in the group? What is the desired result? SteamG00B 1633 — 4y
0
My desired result is for it to show my rank name. For example, it should say "Assistant Director" and not 252. MrOinkerzYT 87 — 4y

2 answers

Log in to vote
0
Answered by
ACHRONlX 255 Moderation Voter
4 years ago

Try using Player:GetRoleInGroup() if you want to get their rank name.

0
Thank you. I'm really stupid and didn't realize I put 'GetRankInGroup' instead of 'GetRoleInGroup'. MrOinkerzYT 87 — 4y
Ad
Log in to vote
0
Answered by
sngnn 274 Moderation Voter
4 years ago

player:GetRankInGroup(GID) will return an integer, which is the rank's "power". Instead, you would use player:GetRoleInGroup(GID) to get the rank name (a string).

(GetRankInGroup vs GetRoleInGroup)

Answer this question