Hey guys here’s a simple name tag and rank name tag script I made
It’s also customizable in the color and font easily.
here’s the code.
local group_id = 7886882 --replace this with the id of your group
local Properties = {
Color = Color3.new(1, 1, 1); --You can customize the color to your preference
Font = Enum.Font.Cartoon; --You can customize the font to your preference
TextStokeColor = Color3.new(0, 0, 0); --this is basically the color that outlines the text
TextStrokeTransparency = 0 --change this to 1 if you dont want a border around the text
}
local bbg = Instance.new("BillboardGui",game.ReplicatedStorage)
bbg.Name = ("NameTag")
bbg.StudsOffset = Vector3.new(0, 2, 0)
bbg.Size = UDim2.new(4,0,1,0)
local txtlbl = Instance.new("TextLabel",bbg)
txtlbl.BackgroundTransparency = 1
txtlbl.TextScaled = true
txtlbl.Size = UDim2.new(1, 0,1, 0)
game.Players.PlayerAdded:Connect(function(player) --PlayerAdded function
player.CharacterAdded:Connect(function(character)
if player:GetRankInGroup(group_id) >=1 then
local role = player:GetRoleInGroup(group_id)
bbg.Parent = game.ReplicatedStorage
local bbg1 = bbg:Clone()
bbg1.Parent = character:WaitForChild("Head")
bbg1.TextLabel.Text = (player.Name..", "..role)
bbg1.TextLabel.TextColor3 = Properties.Color
bbg1.TextLabel.Font = Properties.Font
bbg1.TextLabel.BorderColor3 = Properties.BorderColor
bbg1.TextLabel.TextStrokeTransparency = Properties.TextStrokeTransparency
end
end)
end)
14 Likes
:LoadAsset
doesnt work unless the creator of the game owns the module or its created by roblox. Make it into a module.
1 Like
Edited. Now should work with anyone.
So does this make it so your name in chat like
[Owner]Madden21fan: Wow I like this game I made
[Fan]Haggie125: Oh yes I agree
[Owner]Madden21fan: But your is better
sticluar:How I get those tages?
[Fan]Haggie125: Join the group
Like that in chat?
Sorry for the cringy chat example.
No it’s a name tag simply above your head.
1 Like
Hey, is their a way I can change the position of the points?
1 Like
Ah, I figured this out.No need to worry now.
1 Like
UPDATE I’m going to be completely redoing this system in 2 days, so keep your eye out for the updated version! Also please tell me things you would like to be customizable in the nametag! Thanks for reading, Cats767_99
SHORTENED THE CODE, ADDED NEW FEATURES:
TextStrokeColor
- Color3 value, determines the color of the outline around text
TextStrokeTransparency
You can set this value to 1 if you want text outline turned off, if not set the value to zero
NEW CODE:
local group_id = 7886882 --replace this with the id of your group
local Properties = {
Color = Color3.new(1, 1, 1); --You can customize the color to your preference
Font = Enum.Font.Cartoon; --You can customize the font to your preference
TextStokeColor = Color3.new(0, 0, 0); --this is basically the color that outlines the text
TextStrokeTransparency = 0 --change this to 1 if you dont want a border around the text
}
local bbg = Instance.new("BillboardGui",game.ReplicatedStorage)
bbg.Name = ("NameTag")
bbg.StudsOffset = Vector3.new(0, 2, 0)
bbg.Size = UDim2.new(4,0,1,0)
local txtlbl = Instance.new("TextLabel",bbg)
txtlbl.BackgroundTransparency = 1
txtlbl.TextScaled = true
txtlbl.Size = UDim2.new(1, 0,1, 0)
game.Players.PlayerAdded:Connect(function(player) --PlayerAdded function
player.CharacterAdded:Connect(function(character)
if player:GetRankInGroup(group_id) >=1 then
local role = player:GetRoleInGroup(group_id)
bbg.Parent = game.ReplicatedStorage
local bbg1 = bbg:Clone()
bbg1.Parent = character:WaitForChild("Head")
bbg1.TextLabel.Text = (player.Name.."["..role.."]")
bbg1.TextLabel.TextColor3 = Properties.Color
bbg1.TextLabel.Font = Properties.Font
bbg1.TextLabel.TextStrokeColor3 = Properties.TextStokeColor
bbg1.TextLabel.TextStrokeTransparency = Properties.TextStrokeTransparency
end
end)
end)
This was just a small update. Please leave some feedback or ideas that you think I should add to this to make it a better name tag.
Thanks,
-Cats767_99