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

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

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'.

2 comments

0

Do you not want it to show your rank in the group? What is the desired result?

0

My desired result is for it to show my rank name. For example, it should say "Assistant Director" and not 252.

2 answers

✓ Accepted answer

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

1 comment

0

Thank you. I'm really stupid and didn't realize I put 'GetRankInGroup' instead of 'GetRoleInGroup'.

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)

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