Hiya! I have this code, but I want the division tag to change based on their team, currently it is what team they join on. I’ve worked to the best of my ability, but I am horrible at scripting, any help is appreciated.
local GUI = script.OverheadUI
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Char)
local CloneGUI = GUI:Clone()
local Username = CloneGUI.Username
local Rank = CloneGUI.Rank
local SecondRank = CloneGUI.Division
local SecondGradient = CloneGUI.Division.Gradient
local maingroup = 11357231 -- Change it to your main group ID
Username.Text = Player.Name
SecondRank.Text = Player.Team.Name
if Player:IsInGroup(maingroup) then
Rank.Text = Player:GetRoleInGroup(maingroup)
end
CloneGUI.Parent = Char.Head
SecondGradient.BackgroundColor3 = Player.TeamColor.Color
end)
end)
(Here is an image)