Overhead Rank GUI

I’ve been working on this script for a while. Many people that own groups and group games always look for these and they normally don’t find high quality ones. I’m talking about Overhead Rank GUIs.

I originally made this script for my military group, and I feel like sharing it with other developers now.

Here is what it looks like:
image

Get the script here:
Overhead_Rank_GUI.txt (2.7 KB)

The script is also given in the listing below:

local commands = {}

function Create(ClassName)
	return function(Properties)
		local Obj = Instance.new(ClassName)
		for i,v in pairs(Properties) do
			if type(i) == 'number' then
				v.Parent = Obj
			else
				Obj[i] = v
			end
		end
		return Obj
	end
end
function HandleCharacter(Player, Character)
	local Custom = Character:WaitForChild('Head'):clone()
	Custom.Name = 'AlbOverhead'
	Custom.Parent = Character
	Custom.face:Destroy()
	Character.Head.Transparency = 1
	Create'Weld'{
		Name = 'CustomWeld';
		Parent = Custom;
		Part0 = Character.Head;
		Part1 = Custom;
	}
	Create'BillboardGui'{
		Name = 'Nametag';
		Parent = Custom;
		Size = UDim2.new(5, 0, 0.5, 0);
		StudsOffset = Vector3.new(0, 2, 0);
		Create'TextLabel'{
			Name = 'NameLabel';
			BackgroundTransparency = 1;
			Size = UDim2.new(1, 0, 1, 0);
			Position = UDim2.new(0, 0, -0.8, 0);
			Font = 'SourceSansBold';
			Text = Character.Name;
			TextColor3 = Color3.new(1, 1, 1);
			TextScaled = true;
			TextStrokeTransparency = 0.5;
		};
		Create'TextLabel'{
			Name = 'RankLabel';
			BackgroundTransparency = 1;
			Size = UDim2.new(1, 0, 0.92, 0);
			Position = UDim2.new(0, 0, 0.2, 0);
			TextTransparency = .1;
			Font = 'SciFi';
			FontSize = Enum.FontSize.Size12;
			Text = Player:GetRoleInGroup(ID HERE);
			TextColor3 = Color3.new(1, 1, 1);
			TextScaled = true;
			TextStrokeTransparency = 0.5;
		};
	}

	Custom.BrickColor = Character.Head.BrickColor
	Character.Head.Changed:connect(function()
		Character.Head.Transparency = 1
		Custom.BrickColor = Character.Head.BrickColor
	end)
	Character.Head.Mesh.Changed:connect(function()
		Custom:WaitForChild('Mesh').MeshId = Character.Head:WaitForChild('Mesh').MeshId
	end)
end
local rainbow = function(callback)
local frequency = 0.1
local i = 0 
while true do wait()
local red = math.sin(frequency*i + 0)*127+128 
local green = math.sin(frequency*i + 2*math.pi/3)*127+128 
local blue = math.sin(frequency*i + 4*math.pi/3)*127+128 
callback(Color3.new(red/255,green/255,blue/255)) i = i+1 
end end 
function HandlePlayer(Player)
	if Player.Character then
		HandleCharacter(Player, Player.Character)
	end
	Player.CharacterAdded:connect(function(Character) HandleCharacter(Player, Character) end)
	if Player.UserId == ID HERE or Player.UserId == ID HERE or Player.UserId == ID HERE or Player.UserId == ID HERE then
		Player.CharacterAdded:connect(function(char) local label = char:WaitForChild("AlbOverhead") 
			coroutine.resume(coroutine.create(rainbow),function(color)label.Nametag.RankLabel.TextColor3 = Color3.new(color.r,color.g,color.b)end) 
		end)
	end
end
game.Players.PlayerAdded:connect(function(b)
	HandlePlayer(b)
end)
for i,v in pairs(game.Players:GetPlayers()) do
	 HandlePlayer(v) 
end

To put it in your game simply go under workspace and insert an empty script, then copy/paste the text from the download into the script. Change where it says ID HERE to your group id.

Thank you and I hope this helps, feel free to reply or DM me with any questions.

108 Likes

Wow, thanks man!

maybe now I don’t need to script one myself lol

4 Likes

Thank you for making this this looks better then the ones I have found in the toolbox.

13 Likes

you just change this line to:

TextColor3 = Color3.fromRGB(255,0,0)

to have a plain red color, you can mess with colors however you want though

8 Likes

How did you make the text change colours? Just curious. Also, is there a way to make the rank be a different colour based on rank? Thanks.

4 Likes

I made it rainbow by replacing one of the ID HERE at line 82 with my userID.
It is possible to make the rank be a different colour based on rank but I am not really a scripter so I can’t help you with that, sorry.

1 Like

Use :GetRankInGroup() for color based on a rank.
More information here: Player | Documentation - Roblox Creator Hub

3 Likes

Yes! I have a question, can you make one for rainbow chat?

2 Likes

Thank you so much for saying that it will definitely help me out.

1 Like

Sure I can try. It may take me a while because I am quite busy, but I will totally have that as one of my side projects.

:smiley: !!!

Works only in studio…
I published it.

This is good, but if you plan on making something public, you should make it look FAR cleaner.

Also use Connect instead of connect, it’s deprecated.

As for the way you give the tags, you can make it much simpler.

local Users = {"iiRealistic_Dev",0} -- support username and ID

game:GetService("Players").PlayerAdded:Connect(function(plr)
    if table.find(Users,plr.Name) or table.find(Users,plr.UserId) then
        -- code here
    end
end)

If you’re going to make a “resource” it should be clean and easily readable, not messy.

More importantly, what is the point in the for loop? It isn’t needed.

1 Like

I am not entirely sure, I think that is the pace where I got confused, I made this script a while back for my military group, It Isn’t anything much current. Thank you, however, for the feedback.

The for loop handles all players in the server at the time it’s run, in case players joined before the PlayerAdded event was connected to a function. That way, if the script loads late, players will always have their nametag.

2 Likes

That is probably the reason I made the loop, like I said it was a while ago.

1 Like

You don’t see many decent ones in the toolbox, thanks for sharing!

This overhead GUI looks good! :slight_smile:

1 Like

Bookmarked! This is great for my group!

1 Like

Works great, except for one issue: characters don’t disintegrate into bricks when they die. I’m currently trying to figure out why - I assume it’s related to the manipulations done to the Head.