Rainbow Overhead

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    rainbow for everyone

  2. What is the issue?
    well I have this code, aand i want to make it rainbow for everyone and not only for selected users

code:

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
  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    no

  2. credit goes to @Albanian_Godd

Here

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)
	
		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
game.Players.PlayerAdded:connect(function(b)
	HandlePlayer(b)
end)
for i,v in pairs(game.Players:GetPlayers()) do
	 HandlePlayer(v) 
end

Doesn’t work really, it removes it completly.

Any errors in output? (30 chars)

No, not any at all- :confused:

And what exactly does the first script do, does it work? Does it add the rainbow tag only for you or what?

no it just disappears doesnt even show it like goes bye-bye

Are you sure you provided the script you are using since there is “ID HERE” which would normally throw error.

No when I put my ID it works fine.

Hmmm, then the script I provided should work, did you copy paste it?

um yes i copy pasted (30 chars)

Did you change the group ID? Text = Player:GetRoleInGroup(ID HERE);

um no, but that changes all the functions. and i want it for everyone not specified ranks

So what you want is only rainbow username not the group rank, right?

no i want both to be rainbow for EVERYONE

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)
	
		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); label.Nametag.NameLabel.TextColor3 = Color3.new(color.r,color.g,color.b)end) 
		end)
end
game.Players.PlayerAdded:connect(function(b)
	HandlePlayer(b)
end)
for i,v in pairs(game.Players:GetPlayers()) do
	 HandlePlayer(v) 
end
1 Like

You gotta enter the group id at that line, your group ID.

Okay, I will try tomarrow gtg sleep now

Try changing the id to -1 that should do everybody.