I'm currently working on a project for a group of mine, I have found an old script of a nametag that has both your ROBLOX name, the main group rank and the name of the division you're in, sadly the script has broken for some reason, any help would be greatly appreciated, such as another script that's working or help to fix the current one.
Group ID's, division names and User ID's have been replaced for the sake of simplicity and for the sake of the members.
Thank you for any kind of help!
``"local GUI = script:WaitForChild("Rank")
local DivisionTags = {
-- GroupID, GroupName
{GROUPID, "NAMEOFDIVISION}
{GROUPID, "NAMEOFDIVISION}
{GROUPID, "NAMEOFDIVISION}
{GROUPID, "NAMEOFDIVISION}
{GROUPID, "NAMEOFDIVISION}
{GROUPID, "NAMEOFDIVISION}
{GROUPID, "NAMEOFDIVISION}
{GROUPID, "NAMEOFDIVISION}
{GROUPID, "NAMEOFDIVISION}
{GROUPID, "NAMEOFDIVISION}
{GROUPID, "NAMEOFDIVISION}
}
local CustomNames = {
{PLAYERID, "CUSTOM NAMETAG"},
{PLAYERID, "CUSTOM NAMETAG"},
{PLAYERID, "CUSTOM NAMETAG"},
{PLAYERID, "CUSTOM NAMETAG"},
{PLAYERID, "CUSTOM NAMETAG"},
{PLAYERID, "CUSTOM NAMETAG"},
{PLAYERID, "CUSTOM NAMETAG"},
{PLAYERID, "CUSTOM NAMETAG"},
{PLAYERID, "CUSTOM NAMETAG"},
{PLAYERID, "CUSTOM NAMETAG"},
{PLAYERID, "CUSTOM NAMETAG"},
{PLAYERID, "CUSTOM NAMETAG"},
{PLAYERID, "CUSTOM NAMETAG"},
{PLAYERID, "CUSTOM NAMETAG"
}
function ReturnDivision(Player)
for _,v in pairs(DivisionTags) do
if Player:IsInGroup(v[1]) then
return v[2]
end
end
end
function ReturnCustomName(Player)
for _,v in pairs(CustomNames) do
if Player.UserId == v[1] then
return {v[2], v[3]}
end
end
end
game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
spawn(function()
local GroupName = ReturnDivision(Player)
if Player.TeamColor == BrickColor.new("Bright red") then
wait(.8)
local a = GUI:clone()
a.Adornee = Character:WaitForChild("Head")
a.Frame.Name1.Text = Player.Name
a.Frame.TextLabel.Text = ""
a.Enabled = true
a.Frame.Name1.TextColor3 = Player.TeamColor.Color
a.Parent = Character
elseif Player.TeamColor == BrickColor.new("Bright green") then
wait(.8)
local a = GUI:clone()
a.Adornee = Character:WaitForChild("Head")
a.Frame.Name1.Text = Player.Name
a.Frame.TextLabel.Text = ""
a.Enabled = true
a.Frame.Name1.TextColor3 = Player.TeamColor.Color
a.Parent = Character
elseif Player.TeamColor == BrickColor.new("Bright violet") then
wait(.8)
local a = GUI:clone()
a.Adornee = Character:WaitForChild("Head")
a.Frame.Name1.Text = Player.Name
a.Frame.TextLabel.Text = ""
a.Enabled = true
a.Frame.Name1.TextColor3 = Player.TeamColor.Color
a.Parent = Character
else
if GroupName ~= nil then
local CustomName = ReturnCustomName(Player)
if CustomName ~= nil then
wait(.8)
local a = GUI:clone()
a.Adornee = Character:WaitForChild("Head")
a.Frame.Name1.Text = CustomName[1]
a.Frame.TextLabel.Text = CustomName[2]
a.Enabled = true
a.Frame.Name1.TextColor3 = Player.TeamColor.Color
a.Parent = Character
else
wait(.8)
local a = GUI:clone()
a.Adornee = Character:WaitForChild("Head")
a.Frame.Name1.Text = Player.Name
a.Frame.TextLabel.Text = GroupName .. ", " .. Player:GetRoleInGroup(-emptyforthisquestion-)
a.Enabled = true
a.Frame.Name1.TextColor3 = Player.TeamColor.Color
a.Parent = Character
end
end
end
end)
end)
end)"``

2 comments
oh dear lord please put this in code format
EDIT 1: Put the code in code format, my bad.