My script is only allowed to be on one player how to fix this?

Whenever someone gets teamed they will recieve the certain overhead GUI but when another player gets the overhead GUI it dissapears for the other how do I fix this?

local ServerStorage = game:GetService(“ServerStorage”)
local Tag = ServerStorage.Tag

local CloneTag = Tag:Clone(Tag)
local RankTag = CloneTag.RankTag
local NameTag = CloneTag.NameTag
local GroupTag = CloneTag.GroupTag

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
CloneTag.Parent = char.Head

  if player:GetRankInGroup(12905521) == 251 then
  	RankTag.Text = "Developer"
  elseif player:GetRankInGroup(12905521) == 234 then
  	RankTag.Text = "[E1] Cadet"
  elseif player:GetRankInGroup(12905521) == 235 then
  	RankTag.Text = "[E2] Soldier"
  elseif player:GetRankInGroup(12905521) == 236 then
  	RankTag.Text = "[E3] Soldier First"
  elseif player:GetRankInGroup(12905521) == 237 then
  	RankTag.Text = "[E4] Corporal"
  elseif player:GetRankInGroup(12905521) == 238 then
  	RankTag.Text = "[E5] Sergeant Second"
  elseif player:GetRankInGroup(12905521) == 239 then
  	RankTag.Text = "[E6] Sergeant First"
  elseif player:GetRankInGroup(12905521) == 240 then
  	RankTag.Text = "[O1] Sub-Lieutenant"
  elseif player:GetRankInGroup(12905521) == 241 then
  	RankTag.Text = "[O2] Lieutenant"
  elseif player:GetRankInGroup(12905521) == 242 then
  	RankTag.Text = "[O3] Captain Second"
  elseif player:GetRankInGroup(12905521) == 243 then
  	RankTag.Text = "[O4] Captain First"
  elseif player:GetRankInGroup(12905521) == 244 then
  	RankTag.Text = "[O5] Major"
  elseif player:GetRankInGroup(12905521) == 245 then
  	RankTag.Text = "[O6] Lieutenant Colonel"
  elseif player:GetRankInGroup(12905521) == 246 then
  	RankTag.Text = "[O7] Colonel"
  elseif player:GetRankInGroup(12905521) == 247 then
  	RankTag.Text = "[O8] General Brigadier"
  elseif player:GetRankInGroup(12905521) == 248 then
  	RankTag.Text = "[O9] Brigade General"
  elseif player:GetRankInGroup(12905521) == 249 then
  	RankTag.Text = "[O10] Sub-Division General"
  elseif player:GetRankInGroup(12905521) == 250 then
  	RankTag.Text = "[O11] Divsion General"
  elseif player:GetRankInGroup(12905521) == 252 then
  	RankTag.Text = "Chief of General Staff"
  elseif player:GetRankInGroup(12905521) == 253 then
  	RankTag.Text = "General of the Army"
  elseif player:GetRankInGroup(12905521) == 254 then
  	RankTag.Text = "Secretary of National Defense"
  elseif player:GetRankInGroup(12905521) == 255 then
  	RankTag.Text = "Supremem Commander of the Armed Forces"
  elseif player:GetRankInGroup(12905521) == 0 then
  	RankTag.Text = "Civillian"
  end
  
  NameTag.Text = player.Name
  
  if player:GetRankInGroup(12905521) == 0-255 then
  	NameTag.Text = Player.Name
  end
  
  
  
  if player.TeamColor == BrickColor.new("Really black") then
  	GroupTag.Text = "Special Forces"
  	GroupTag.TextColor3 = Color3.new(1, 1, 1)
  	GroupTag.BackgroundColor3 = Color3.new(0, 0, 0)
  	NameTag.TextColor3 = Color3.new(0, 0, 0)
   elseif player.TeamColor == BrickColor.new("Deep orange") then
  	GroupTag.Text = "Executive Branch"
  	GroupTag.DivIcon.Image = "http://www.roblox.com/asset/?id=".."14123361077"
      GroupTag.BackgroundColor3 = Color3.new(0.705882, 0.576471, 0.192157)
      GroupTag.TextColor3 = Color3.new(0, 0, 0)
  	NameTag.TextColor3 = Color3.new(0.705882, 0.576471, 0.192157)
  elseif player.TeamColor == BrickColor.new("CGA brown") then
  	GroupTag.Text = "National Guard"
  	GroupTag.DivIcon.Image = "http://www.roblox.com/asset/?id=".."14112268088"
  	GroupTag.BackgroundColor3 = Color3.new(0.529412, 0.321569, 0.129412)
  	GroupTag.TextColor3 = Color3.new(0, 0, 0)
  	NameTag.TextColor3 = Color3.new(0.529412, 0.321569, 0.129412)
  elseif player.TeamColor == BrickColor.new("Gold") then
  	GroupTag.Text = "Training Academy"
  	GroupTag.DivIcon.Image = "http://www.roblox.com/asset/?id=".."14112272475"
  	GroupTag.BackgroundColor3 = Color3.new(0.827451, 0.682353, 0.109804)
  	GroupTag.TextColor3 = Color3.new(0, 0, 0)
  	NameTag.TextColor3 = Color3.new(0.827451, 0.682353, 0.109804)
  elseif player.TeamColor == BrickColor.new("Lily White") then
  	GroupTag.Text = "Foreign Affairs"
  	GroupTag.DivIcon.Image = "http://www.roblox.com/asset/?id=".."14112281400"
  	GroupTag.BackgroundColor3 = Color3.new(0.792157, 0.792157, 0.792157)
  	GroupTag.TextColor3 = Color3.new(0, 0, 0)
  	NameTag.TextColor3 = Color3.new(0.792157, 0.792157, 0.792157)
  elseif player.TeamColor == BrickColor.new("Dark stone grey") then
  	GroupTag.Text = "Internal Affairs"
  	GroupTag.DivIcon.Image = "http://www.roblox.com/asset/?id=".."14112277080"
  	GroupTag.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
  	GroupTag.TextColor3 = Color3.new(0, 0, 0)
  	NameTag.TextColor3 = Color3.new(0.309804, 0.309804, 0.309804)
  elseif player.TeamColor == BrickColor.new("Fossil") then
  	GroupTag.Text = "Customs office"
  	GroupTag.DivIcon.Image = "http://www.roblox.com/asset/?id=".."14112279210"
  	GroupTag.BackgroundColor3 = Color3.new(0.309804, 0.309804, 0.309804)
  	GroupTag.TextColor3 = Color3.new(0.678431, 0.678431, 0.678431)
  	NameTag.TextColor3 = Color3.new(0.309804, 0.309804, 0.309804)
  end

end)
end)

You are parenting the same clone tag initialized at the top of the script to a new character head everytime for every player. You need to clone the tag inside the CharacterAdded event.

3 Likes

So what would the script at the top change to if you can paste it here?

You want to make a new clone for each character, so we will move the cloning into CharacterAdded

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        local CloneTag = Tag:Clone(Tag)
        local RankTag = CloneTag.RankTag
        local NameTag = CloneTag.NameTag
        local GroupTag = CloneTag.GroupTag
        CloneTag.Parent = char.Head

-- the rest of your script! ...

Thank you so much it helped me alot