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

How would I get certain ranks in my group be certain colors?

I really tried a lot, and I don't want to be sloppy with this code so this is why i'm going this route, so far I have this. https://media.discordapp.net/attachments/414167391178719233/423693833948364800/unknown.png

Also the normal script function does not display a rank at all when I have that in, but it does when that part is remove.

local billboardgui = game:GetService("ServerStorage"):WaitForChild("BillboardGui")
game.Players.PlayerAdded:Connect(function(player)
	Player.CharacterAdded:Connect(function(char)
	if player:IsInGroup(3889222) then
		local clonedgui = billboardgui:Clone()
		clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head
		clonedgui.TextLabel.Text = player:GetRoleInGroup(3889222)
		clonedgui.TextLabel.TextColor3 = Color3.fromRGB(0,0,0)
	end
	if Player.GetRankInGroup(3889222) == "[Class-D]" then
		clonedgui.TextLabel.TextColor3 = Color3.fromRGB(255,165,0)
	end
end)

1 comment

1 answer

Your script looks fine but at line 10 use GetRoleInGroup or change "[Class-D]" for the number because GetrankinGroup returns a number So just do something like this.

local billboardgui = game:GetService("ServerStorage"):WaitForChild("BillboardGui")
game.Players.PlayerAdded:Connect(function(player)
    Player.CharacterAdded:Connect(function(char)
    if player:IsInGroup(3889222) then
        local clonedgui = billboardgui:Clone()
        clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head
        clonedgui.TextLabel.Text = player:GetRoleInGroup(3889222)
        clonedgui.TextLabel.TextColor3 = Color3.fromRGB(0,0,0)
    end
    if Player.GetRoleInGroup(3889222) == "[Class-D]" then
        clonedgui.TextLabel.TextColor3 = Color3.fromRGB(255,165,0)
    end
end)

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